物理网卡eth0 eth1绑定为bond0
物理网卡配置
ifcfg-eth0
DEVICE=eth0
ONBOOT=yes
BOOTPROTO=none
MASTER=bond0
SLAVE=yes
ifcfg-eth1
DEVICE=eth1
ONBOOT=yes
BOOTPROTO=none
MASTER=bond0
SLAVE=yes
bond0网卡配置
ifcfg-bond0
DEVICE=bond0
ONBOOT=yes
BOOTPROTO=none
IPADDR=xx.xx.xx.xx
NETMASK=xx.xx.xx.xx
GATEWAY=xx.xx.xx.xx
DNS1=xx.xx.xx.xx
BONDING_OPTS="mode=0 miimon=100"
重启网卡
service network restart
查看bond0状态
[root@test ~]# cat /proc/net/bonding/bond0
Ethernet Channel Bonding Driver: v3.6.0 (September 26, 2009)
Bonding Mode: load balancing (round-robin)
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:56:a4:92
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:56:a4:9c
Slave queue ID: 0
拔掉eth1网线并查看日志
[root@test ~]# tail -f /var/log/messages
Jan 15 15:36:24 test kernel: e1000: eth1 NIC Link is Down
Jan 15 15:36:24 test kernel: bonding: bond0: link status definitely down for interface eth1, disabling it
插上eht1网线并查看日志
Jan 15 15:43:56 test kernel: e1000: eth1 NIC Link is Up 1000 Mbps Full Duplex, Flow Control: None
Jan 15 15:43:56 test kernel: bond0: link status definitely up for interface eth1, 1000 Mbps full duplex.