eth0 ----\
--绑定--> bond0
eth1 ----/
配置文件目录:
# cd /etc/sysconfig/network-scripts/
1、配置bond0
# Intel Corporation 82571EB Gigabit Ethernet Controller
DEVICE=bond0
BOOTPROTO=static
BROADCAST=192.168.1.255
IPADDR=192.168.1.10
NETMASK=255.255.255.0
NETWORK=192.168.1.0
ONBOOT=yes
TYPE=Ethernet
2、配置eth0
# ifcfg-eth0
# Intel Corporation 82571EB Gigabit Ethernet Controller
DEVICE=eth0
BOOTPROTO=none
MASTER=bond0
ONBOOT=yes
3、配置eth1
# ifcfg-eth1
# Intel Corporation 82571EB Gigabit Ethernet Controller
DEVICE=eth1
BOOTPROTO=none
MASTER=bond0
ONBOOT=yes
4、开机引导
# /etc/modprobe.conf
加入:
alias bond0 bonding
options bond0 miimon=100 mode=0
注意:
miimon 用来进行链路检测,单位:毫秒
mode可以为0, 1;0为负载均衡,1为失效保护
# vi /etc/rc.d/rc.local
加入:
ifenslave bond0 eth0 eth1
route add -net 192.168.1.0 netmask 255.255.255.0 bond0
route add -net 0.0.0.0 netmask 0.0.0.0 gw 192.168.1.1 bond0
# reboot
# cat /proc/net/bonding/bond0
搞定,Good luck!!!