bond内核模块和称为通道绑定接口的特殊网络,接口将多个网络接口绑定到一个通道。
根据选择的绑定模式,通道绑定使两个或者更多个网络接口作为一个网络接口,从而增加带宽或者提供冗余性
模式0(平衡轮循) - 轮循策略,所有 接口都采用轮循方式在所有slave中传输封包,任何slave都可以接收
模式1(主动备份) - 容错, 一次只能使用一个slave接口,但是如果该接口出现故障,另一个slave将接替它
模式3(广播) - 容错, 所有封包都将通过所有slave接口广播
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
cat /etc/sysconfig/network-scripts/ifcfg-eth0
DEVICE=eth0
HWADDR=00:0C:29:45:17:69
TYPE=Ethernet
UUID=2a0d57d6-4cc6-4fb0-82b0-6efe7cef4d14
ONBOOT=yes
BOOTPROTO=none
SLAVE=yes
MASTER=bond0
cat /etc/sysconfig/network-scripts/ifcfg-eth1
DEVICE=eth1
HWADDR=00:0C:29:45:17:73
TYPE=Ethernet
UUID=62962214-47ea-4791-866c-08b2e004af83
ONBOOT=yes
BOOTPROTO=none
SLAVE=yes
MASTER=bond0
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
来源:oschina
链接:https://my.oschina.net/u/4415089/blog/4300606