我已经设置了 ubuntu 服务器 16.04。已安装两块网卡,均连接到单个网络 172.18.6.0/24。它们具有不同的 IP,因此如果一个发生故障,另一个可以保持活动。
# The loopback network interface
auto lo
iface lo inet loopback
# The primary network interface
auto eth0
iface eth0 inet static
address 172.18.6.101
netmask 255.255.255.0
gateway 172.18.6.1
# eth1 config
auto eth1
iface eth1 inet static
address 172.18.6.102
netmask 255.255.255.0
gateway 172.18.6.1
但设置后,我发现一个网卡正在连接,另一个没有连接。当我这样做时,两者都出现了
ip a
1: lo: <LOOPBACK,UP,LOWER_UP> mtu 65536 qdisc noqueue state UNKNOWN group default qlen 1
link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00
inet 127.0.0.1/8 scope host lo
valid_lft forever preferred_lft forever
inet6 ::1/128 scope host
valid_lft forever preferred_lft forever
2: eth0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc mq state UP group default qlen 1000
link/ether 00:15:5d:00:5a:12 brd ff:ff:ff:ff:ff:ff
inet 172.18.6.101/24 brd 172.18.6.255 scope global eth0
valid_lft forever preferred_lft forever
inet6 fe80::215:5dff:fe00:5a12/64 scope link
valid_lft forever preferred_lft forever
3: eth1: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc mq state UP group default qlen 1000
link/ether 00:15:5d:00:5a:13 brd ff:ff:ff:ff:ff:ff
inet 172.18.6.102/24 brd 172.18.6.255 scope global eth1
valid_lft forever preferred_lft forever
inet6 fe80::215:5dff:fe00:5a13/64 scope link
valid_lft forever preferred_lft forever
我怎样才能使两个 NIC 都处于活动状态?