Centos 双网卡绑定

[root@Study ~]# cat /etc/sysconfig/network-scripts/ifcfg-eth0
DEVICE=eth0
ONBOOT=yes
BOOTPROTO=none
USERCTL=no
MASTER=bond0
SLAVE=yes
[root@Study ~]# cat /etc/sysconfig/network-scripts/ifcfg-eth1
DEVICE=eth1
ONBOOT=yes
BOOTPROTO=none
USERCTL=no
MASTER=bond0
SLAVE=yes
[root@Study ~]#

[root@Study ~]# cat /etc/sysconfig/network-scripts/ifcfg-bond0
DEVICE=bond0
ONBOOT=yes
BOOTPROTO=none
IPADDR=192.168.61.101
NETMASK=255.255.255.0
GATEWAY=192.168.61.2
[root@Study ~]#

 

这时候网卡绑定还没有生效,需要进行模块加载

[root@root ~]# cd /etc/modprobe.d/

切换到modprobe.d目录下

[root@root ~modprobe.d]#vi dist.conf

#加载bonding模块,对外虚拟网络接口设备为bond0,在最后加入以下2行

alias bond0 bonding

options bond0 mode=6 miimon=100

 

模式6,为发送接收都能自动的负载均衡

模式1 为,active/standby 模式

Leave a Comment