1、加载bonding模块
modprobe bonding
lsmod |grep bonding
2、修改网卡配置文件
cd /etc/sysconfig/network-scripts/
cat ifcfg-enp1s0
TYPE=Ethernet
BOOTPROTO=none
NAME=enp1s0
DEVICE=enp1s0
ONBOOT=yes
MASTER=bond4
SLAVE=yes
cat ifcfg-enp7s0
TYPE=Ethernet
BOOTPROTO=none
NAME=enp7s0
DEVICE=enp7s0
ONBOOT=yes
MASTER=bond4
SLAVE=yes
cat ifcfg-bond4 #创建bond网卡文件
TYPE=Bond
BOOTPROTO=static
DEVICE=bond4
NAME=bond4
ONBOOT=yes
IPADDR=10.12.21.194
NETMASK=255.255.255.0
GATEWAY=10.12.21.1
DNS1=10.12.0.10
BONDING_MASTER=yes
BONDING_OPTS="mode=4 miimon=100 lacp_rate=fast arp_validate=0"
跨网段可以更换下面参数:
BONDING_OPTS="mode=4 miimon=100 lacp_rate=fast xmit_hash_plicy=laye3+4"
3、重启服务,使配置生效
systemctl restart NetworkManager
nmcli connection up bond4
4、bonding状态查看
cat /proc/net/bonding/bond4