(更新!!!:以下方法经测试会出现交换机mac地址失效问题,解决方法是延续redhat 5的通常配置,并关闭NetworkManager服务。) 服务器型号为HP DL380 G7 有四个网络接口,其中第一口和第三口连接到不同的交换机,需要绑定一个IP,做成主备模式。 对于redhat 5及以前版本,网上有很多教程,很简单,但对于redhat 6并不可用。在尝试多次之后,总结配置如下:
以服务器10.199.74.68为例,子网掩码为255.255.255.224,网关为10.199.74.73
/etc/modprobe.conf
alias bond0 bonding
options bond0 mode=1 arp_ip_target=10.199.74.73 arp_interval=60
alias eth0 tg3
alias eth2 tg3
alias eth1 e1000
alias eth3 e1000
add above bonding e1000 tg3
/etc/rc.local
/sbin/route add default gw 10.199.74.73 dev bond0
ifcfg-bond0
DEVICE=bond0
IPADDR=10.199.74.68
NETMASK=255.255.255.224
NETWORK=10.199.74.64
BROADCAST=10.199.74.95
ONBOOT=yes
BOOTPROTO=none
USERCTL=no
BONDING_opts="mode=active-backup arp_interval=60 arp_ip_target=10.199.74.73"
ifcfg-eth0
DEVICE=eth0
USERCTL=no
ONBOOT=yes
MASTER=bond0
SLAVE=yes
BOOTPROTO=none
ifcfg-eth2
DEVICE=eth2
USERCTL=no
ONBOOT=yes
MASTER=bond0
SLAVE=yes
BOOTPROTO=none