1.設置開機加載bonding模塊
vi /etc/modprobe.d/bonding.conf 加入以下兩行:
alias bond0 bonding options bond0 miimon=100 mode=0
#mode0表示負載均衡
2 修改網卡配置文件
cd /etc/sysconfig/network-scripts/ ,新建ifcfg-bond0文件 ,內容如下:
DEVICE=bond0
IPADDR=192.168.100.198
NETMASK=255.255.255.0
NETWORK=192.168.198.1
ONBOOT=yes
NAME=bond0
BOOTPROTO=none
USERCTL=no
GATEWAY=192.168.198.1
修改想要做成bond的網卡的配置文件,如ifcfg-eth2、ifcfg-eth3,內容分別如下:
DEVICE=eth2
ONBOOT=yes
BOOTPROTO=none
USERCTL=no
MASTER=bond0
SLAVE=yes
DEVICE=eth3
ONBOOT=yes
BOOTPROTO=none
USERCTL=no
MASTER=bond0
SLAVE=yes
3 重啓系統,使配置生效