今天开始把之前的一些记录放上来,做一些梳理~~~
两块网卡(比如eth0和eth1绑定成bond0)绑定成一个,冗余
有七种模式,主要用的是主备模式(mode1),mode0是负载均衡,只需要改一下mode值就可以了
1.
首先编辑eth0和eth1文件
DEVICE=eth0
ONBOOT=yes
BOOTPROTO=none
MASTER=bond0
SLAVE=yes
2.
然后编辑bond0的配置文件
配置成静态的,固定IP
DEVICE=bond0
ONBOOT=yes
BOOTPROTO=none
IPADDR=IP地址
NETMASK=255.255.255.0
3.
然后编辑配置文件:
添加
alias bond0 bonding
options bonding miimon=100 mode=1
miimon表示每100ms监测一次链路状态,如果不通则转到另一条线上
4.
modprob bonding
加载bonding这个模块
5.
在开机脚本/etc/rc.local中,增加eth0和eth1的绑定
ifenslave bond0 eth0 eth1
6.重启
/etc/init.d/network restart
</