- 实验目的双网卡绑定,解决负载均衡和主备自动切换。
- Linux操作系统6.5,bond0,eth1,eth2.
- bond0 10.10.9.126 eth1无 eth2无。
- 配置如下:
- cd /etc/sysconfig/network-scripts/ /进入网络配置文件中
- cp ifcfg-eth0 ifcfg-bond0 /复制ifcfg-eth0 改名为ifcfg-bond0 原来的ifcfg-eth0继续存在
-
配置ifcfg-bond0
DEVICE=bond0
BOOTPROTO=none
ONBOOT=yes
IPADDR=10.10.9.126
DNS=202.106.196.115
NETMASK=255.255.255.0
GATEWAY=10.10.9.3
TYPE=Ethernet
-
配置ifcfg-eth1
TYPE=Ethernet
DEVICE=eth1
BOOTPROTO=static
-
配置ifcfg-eth2
DEVICE=eth2
-
配置vi /etc/rc.d/rc.local
ifenslave bond0 eth2 eth1
route add -net 10.10.0.0. netmask 255.255.255.0 bond0
-
配置etc/moprobe.conf
alias eth2 e1000
alias eth1 e1000
alias bond0 bonding
option bond0 miimon=100 mode=0 /mode 参数有0,1,2,3
0=负载均衡方式,两块网卡都工作