環境:
OS: redhat 8.0
1. #cd /etc/sysconfig/network-scripts
# cp ifcfg-eth0 ifcfg-bond0
----------------------------------------------------------------
2 #vi ifcfg-bond0
將第一行改成 DEVICE=bond0
----------------------------------------------------------------
3 # vi /etc/modules.conf
加入兩行
alias bond0 bonding
options bond0 miimon=100 mode=1
----------------------------------------------------------------
4 # vi /etc/rc.d/rc.local
加入兩行
ifenslave bond0 eth0 eth1
route add -net 192.168.0.0 netmask 255.255.255.0 bond0
----------------------------------------------------------------
5 reboot
重啟會看見:
................
Bringing up interface bond0 [color=green:c8a84ac3e6]OK[/color:c8a84ac3e6]
Bringing up interface eth0 [color=green:c8a84ac3e6]OK[/color:c8a84ac3e6]
Bringing up interface bond1 [color=green:c8a84ac3e6]OK[/color:c8a84ac3e6]
----------------------------------------------------------------
6. 檢查:
#netstat -r
192.168.0.0 255.255.255.0 0 40 0 0 bond0
192.168.0.0 255.255.255.0 0 40 0 0 eth0
192.168.0.0 255.255.255.0 0 40 0 0 eth1
這時候看看你的網卡後面的燈, 他們閃的頻率是一樣的.OK.
當#ifdown eth0 時, 轉換有5-6秒的延時.
----------------------------------------------------------------
注意:
如果網絡不通需要從啟bind
# ifdown bind0
#ifup bind0
網卡綁定用在vncserver 或scp中就不靈了
祝大家綁定成功!!!!有問題多交流.