eth0     192.168.1.104    eth1     192.168.1.105

bound  192.168.1.106


软件配置

cp -pv /etc/sysconfig/selinux /etc/sysconfig/selinux.bak

echo 'SELINUX=disabled'  > /etc/sysconfig/selinux


cp -pv /etc/sysconfig/network-scripts/ifcfg-eth0 /etc/sysconfig/network-scripts/ifcfg-eth0.bak

cp -pv /etc/sysconfig/network-scripts/ifcfg-eth1 /etc/sysconfig/network-scripts/ifcfg-eth1.bak


echo MASTER=bond0    >> /etc/sysconfig/network-scripts/ifcfg-eth0 

echo SLAVE=yes          >> /etc/sysconfig/network-scripts/ifcfg-eth0

echo MASTER=bond0   >> /etc/sysconfig/network-scripts/ifcfg-eth1

echo SLAVE=yes  >> /etc/sysconfig/network-scripts/ifcfg-eth1


cat /etc/sysconfig/network-scripts/ifcfg-bond0

DEVICE=bond0

TYPE=Ethernet 

USERCTL=no 

ONBOOT=yes 

#BONDING_OPTS="miimon=100 mode=1" 

BOOTPROTO=static 

IPADDR=192.168.1.106   

NETMASK=255.255.255.0  

GATEWAY=192.168.1.1  


cp -pv /etc/modprobe.d/dist.conf  /etc/modprobe.d/dist.conf.bak

echo 'alias bond0 bonding' >> /etc/modprobe.d/dist.conf

echo 'options bond0 miimon=100 mode=1' >> /etc/modprobe.d/dist.conf

less /etc/modprobe.d/dist.conf | grep bond

alias bond0 bonding

options bond0 miimon=100 mode=1


cp -pv /etc/rc.d/rc.local  /etc/rc.d/rc.local.bak

echo 'ifenslave bond0 eth0 eth1'  >>  /etc/rc.d/rc.local

less /etc/rc.d/rc.local | grep bond

ifenslave bond0 eth0 eth1

service NetworkManager stop  && chkconfig NetworkManager off

service network restart


ip addr | grep bond

4: bond0: <BROADCAST,MULTICAST,MASTER,UP,LOWER_UP> mtu 1500 qdisc noqueue state UP 

    inet 192.168.1.106/24 brd 192.168.1.255 scope global bond0


cat /proc/net/bonding/bond0  

Ethernet Channel Bonding Driver: v3.7.1 (April 27, 2011)


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:e7:cc:8a

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:e7:cc:94

Slave queue ID: 0