linux7网口起不来,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

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值