centos7配网卡_centos7配置多网卡bond

配置网卡1 vi /etc/sysconfig/network-scripts/ifcfg-eno16777736

TYPE=Ethernet

BOOTPROTO=none

USERCTL=no

DEVICE=eno16777736

ONBOOT=yes

MASTER=bond0

SLAVE=yes

配置网卡2 vi /etc/sysconfig/network-scripts/ifcfg-eno33554944

TYPE=Ethernet

BOOTPROTO=none

USERCTL=no

DEVICE=eno33554944

ONBOOT=yes

MASTER=bond0

SLAVE=yes

配置虚拟bond网卡 vi /etc/sysconfig/network-scripts/ifcfg-bond0

TYPE=Bond

BOOTPROTO=none

ONBOOT=yes

USERCTL=no

DEVICE=bond0

IPADDR=192.168.121.129

PREFIX=24

NM_CONTROLLED=no

BONDING_MASTER=yes

配置bonding驱动 vi /etc/modprobe.d/bond.conf

alias bond0 binding

options bond0 miimon=100 mode=1

centos7默认没有加bonding内核模板,加载方式modprobe --first-time bonding

查看是否加载成功 lsmod | grep bonding 或者 modinfo bonding

重启网络服务service network restart

可能会启动失败,bond0的状态不是UP, 查看/var/log/message可看到如下信息

Error: Connection activation failed: Master device bond0 unmanaged or not available for activation

需要禁用NetworkManager

systemctl stop NetworkManager.service

systemctl disable NetworkManager.service

参考地址https://access.redhat.com/discussions/2162171

启动network后的结果

cat /proc/net/bonding/bond0

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值