vi /etc/inittab
78:35:once:/root/bond.sh &
vi /root/bond.sh
rmmod bond 清除bond信息
modprobe bonding -o bond0 mode=802.3ad xmit_hash_policy=layer3+4
參數詳解 參見博客 http://www.linuxidc.com/Linux/2011-05/35326.htm
modprobe bonding -o bond1 mode=802.3ad xmit_hash_policy=layer3+4
ifconfig bond0 30.30.2.110 netmask 255.255.0.0 up //給bond 0綁定ip
ifconfig bond1 30.30.2.111 netmask 255.255.0.0 up
ifenslave bond0 eth0 eth1 eth4 eth5 //將0,1,4,5做成一個bond
ifenslave bond1 eth2 eth3 eth6 eth7
route add default gw 30.30.30.2
service sshd restart
在做bond前,要先修改一下inittab文件,如果沒有的話可以自己創建這個文件。做bond是爲了負載均衡和容災。
78:35:once:/root/bond.sh &