标签:双网卡绑定
3个文件bond0是需要创建的文件,其他2个是网卡文件ifcfg-bond0
ifcfg-ens33
ifcfg-ens37
BOOTPROTO=none
BOOTPING_MASTER=yes
DEVICE=bond0
ONBOOT=yes
NAME=bond0
IPADDR=192.168.10.10
NETMASK=255.255.255.0
GATEWAY=192.168.10.2
USERCTL=no
PEERDNS=yes
TYPE=Ethernet
BONDING_OPTS="mode=1 miimon=100"
DNS1=1.1.1.1
DNS2=8.8.8.8
BOOTPROTO=static
DEVICE=ens33
NAME=ens33
ONBOOT=yes
MASTER=bond0
SLAVE=yes
TYPE=Ethernet
USERCTL=no
BOOTPROTO=static
DEVICE=ens37
NAME=ens37
ONBOOT=yes
MASTER=bond0
SLAVE=yes
TYPE=Ethernet
USERCTL=no
4.重启机器reboot,然后ping网关是否可以通,如果不通,需要检查网卡配置
通了以前验证环境cat /proc/net/bonding/bond0
---------------一下是内容信息----------------------------------------
Ethernet Channel Bonding Driver: v3.7.1 (April 27, 2011)
Bonding Mode: fault-tolerance (active-backup)
Primary Slave: None
Currently Active Slave: ens33 #当前的主接口
MII Status: up
MII Polling Interval (ms): 100
Up Delay (ms): 0
Down Delay (ms): 0
Slave Interface: ens33
MII Status: up
Speed: 1000 Mbps
Duplex: full
Link Failure Count: 1
Permanent HW addr: 00:0c:29:57:cb:c2
Slave queue ID: 0
Slave Interface: ens37
MII Status: up
Speed: 1000 Mbps
Duplex: full
Link Failure Count: 1
Permanent HW addr: 00:0c:29:57:cb:cc
Slave queue ID: 0
5.验证环境就是宕掉主接口,另一个接口会不是变成主接口。
标签:双网卡绑定
原文地址:http://blog.51cto.com/243662875/2107044