配置网卡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
热门评论
今天给7做bond死活起不来说不兼容,也是这个问题,多谢