环境:
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中就不灵了
祝大家绑定成功!!!!有问题多交流.