双网卡绑定一个IP,bond,捆绑

 双网卡绑定一个IP,bond,捆绑

 双网卡绑定一个IP

步骤1:新建/etc/sysconfig/network-scripts/ifcfg-bond0文件
DEVICE=bond0
ONBOOT=yes
BOOTPROTO=static
IPADDR=xxx.xxx.xxx.xxx
NETMASK=xxx.xxx.xxx.xxx
GATEWAY=xxx.xxx.xxx.xxx
USERCTL=no
步骤2:更改/etc/sysconfig/network-scripts/ifcfg-eth0网卡
DEVICE=eth0
ONBOOT=yes
BOOTPROTO=none
MASTER=bond0
USERCTL=no
步骤3:更改/etc/sysconfig/network-scripts/ifcfg-eth1网卡
DEVICE=eth1
ONBOOT=yes
BOOTPROTO=none
MASTER=bond0
USERCTL=no
步骤4:编辑 /etc/modprobe.d/dist.conf最后一行添加)
alias bond0 bonding
options bond0 miimon=100 mode=0
步骤5:加入/etc/rc.d/rc.local启动项
ifenslave bond0 eth0 eth1    

步骤6:重启下机器

reboot 

步骤7:测试(网线从eth0拔下插到eth1还能正常ping通测配置成功)

附:查看bond0状态,查看eth0 和eth1 的up、down 状态

cat /proc/net/bonding/bond0

猜你喜欢

转载自www.cnblogs.com/zhangyunfei-blog/p/9288472.html