Bonding Mode: fault-tolerance (active-backup) Primary Slave: None Currently Active Slave: eth0 MII Status: up MII Polling Interval (ms): 100 Up Delay (ms): 0 Down Delay (ms): 0
Slave Interface: eth0 MII Status: up Speed: 1000 Mbps Duplex: full Link Failure Count: 0 Permanent HW addr: 00:0c:29:8c:f7:3d Slave queue ID: 0
Slave Interface: eth1 MII Status: up Speed: 1000 Mbps Duplex: full Link Failure Count: 0 Permanent HW addr: 00:0c:29:8c:f7:47 Slave queue ID: 0
Currently Active Slave: eth0现在主要工作的是eth0。 虚拟机断开网卡1的连接。 再查看信息。
Bonding Mode: fault-tolerance (active-backup) Primary Slave: None Currently Active Slave: eth1 MII Status: up MII Polling Interval (ms): 100 Up Delay (ms): 0 Down Delay (ms): 0
Slave Interface: eth0 MII Status: down Speed: Unknown Duplex: Unknown Link Failure Count: 1 Permanent HW addr: 00:0c:29:8c:f7:3d Slave queue ID: 0
Slave Interface: eth1 MII Status: up Speed: 1000 Mbps Duplex: full Link Failure Count: 0 Permanent HW addr: 00:0c:29:8c:f7:47 Slave queue ID: 0
eth0的MII Status: down,所以现在Currently Active Slave: eth1。ping一下连通性没有问题,中间断了一下,是那个ICMP包正好处于链路检测时间内,系统尚未判断eth0挂掉,也就还没有启动eth1,导致了无响应。 此时,如果再断开网卡2,则网络全部挂掉;或若重启网卡1,由于网卡2工作正常,网卡1变为备用网卡。通过命令cat /proc/net/bonding/bond0均能看到其详细信息。
其他
本章未亲自测试过。 A. CentOS7的双网卡绑定可以采用Team模式,或者旧有的bond模式。 B. 多网卡绑定多个bond,只是在/etc/modprobe.d/dist.conf的内容有所不同。 多个bond设置成相同的模式。
1 2 3
alias bond0 bonding alias bond1 bonding options bonding max_bonds=2 miimon=200 mode=1