centos7 双网口绑定

1、关闭和停止NetworkManager服务
systemctl stop NetworkManager.service # 停止NetworkManager服务
systemctl disable NetworkManager.service # 禁止开机启动NetworkManager服务
ps: 一定要关闭,不关会对做bonding有干扰

2、加载bonding模块
modprobe --first-time bonding
没有提示说明加载成功, 如果出现modprobe: ERROR: could not insert 'bonding': Module already in kernel说明你已经加载了这个模块
也可以使用lsmod | grep bonding查看模块是否被加载
lsmod | grep bonding
bonding 146875 0

接下来 使用 ip a 查看 bond0 虚拟网卡

3.配置网卡
[root@jupiter network-scripts]# cat ifcfg-bond0
TYPE=Ethernet
BOOTPROTO=static
NAME=bond0
DEVICE=bond0
ONBOOT=yes
IPADDR=13.13.13.2
NETMASK=255.255.0.0
BONDING_OPTS="mode=6 miimon100"

[root@jupiter network-scripts]# cat ifcfg-p9p1
TYPE=Ethernet
BOOTPROTO=static
NAME=p9p1
DEVICE=p9p1
ONBOOT=yes
MASTER=bond0
SLAVE=yes

[root@jupiter network-scripts]# cat ifcfg-p9p2
TYPE=Ethernet
BOOTPROTO=static
NAME=p9p2
DEVICE=p9p2
ONBOOT=yes
MASTER=bond0
SLAVE=yes

4.重启网络:systemctl restart network
5。
查看bond0的接口状态信息 ( 如果报错说明没做成功,很有可能是bond0接口没起来)
cat /proc/net/bonding/bond0

posted @ 2019-11-01 15:29  lvph  阅读(1134)  评论(0编辑  收藏  举报