百度知道:http://jingyan.baidu.com/album/25648fc1a2cbc99190fd007a.html?picindex=1
一、新建bond文件
/etc/sysconfig/network-scripts/ifcfg-bond0
1 2 3 4 5 6 7 |
DEVICE=bond0 ONBOOT=yes BOOTPROTO=static IPADDR=8.8.8.8 PREFIX=24 GATEWAY=9.9.9.9 BONDING_OPTS="mode=1 miimon=100" |
配上网络,以后的网络出入都走这个。
mode=1指主备,0则为负载均衡。
miimon=100的意思就是,每100毫秒检测网卡和交换机之间是否连通,如不通则使用另外的链路
二、修改网卡文件
物理网卡配置到bond上。
/etc/sysconfig/network-scripts/ifcfg-eth0
1 2 3 4 5 |
DEVICE=eth0 ONBOOT=yes BOOTPROTO=none MASTER=bond0 SLAVE=yes |
同理另一块网卡
/etc/sysconfig/network-scripts/ifcfg-eth1
1 2 3 4 5 |
DEVICE=eth1 ONBOOT=yes BOOTPROTO=none MASTER=bond0 SLAVE=yes |
三、修改/etc/modprobe.d/dist.conf
添加以下行
1 2 |
alias bond0 bonding options bond0 miimon=100 mode=1 |
运行
1 |
modprobe -i bonding |
四、重启网络
1 |
service network restart |