系统环境
CentOS 5.3
目前主流的Linux内核(2.6)已经默认支持bonding模块,无需做特别处理。
配置步骤
编写bond0网卡配置
# vi /etc/sysconfig/network-scripts/ifcfg-bond0
DEVICE=bond0
IPADDR=192.168.1.20
NETWORK=192.168.1.0
NETMASK=255.255.255.0
BOOTPROTO=none
ONBOOT=yes
修改eth0和eth1网卡配置
# vi /etc/sysconfig/network-scripts/ifcfg-eth0
DEVICE=eth0
ONBOOT=yes
MASTER=bond0
SLAVE=yes
BOOTPROTO=none
# vi /etc/sysconfig/network-scripts/ifcfg-eth1
DEVICE=eth1
ONBOOT=yes
MASTER=bond0
SLAVE=yes
BOOTPROTO=none
加载bonding模块
# vi /etc/modprobe.conf
alias bond0 bonding
options bond0 miimon=100 mode=6
#注: bond options中miimon指定了MII连接监控频率(微秒),mode指定bond的策略,6为balance-alb模式,此模式不需要交换机特别配置支持,bond的参数具体参考这里
装载bonding模块
# modprobe bonding
重启网络服务
# service network restart
检查配置生效
# cat /proc/net/bonding/bond0
# ifconfig
联系客服