bond驱动加载
[root@compute1 ~]# vim /etc/modprobe.d/bond.conf # 开机自动加载bonding驱动
alias bond0 bonding
options bond0 miimon=100 mode=0 # miimon:多长时间检查一次网络,单位ms;
首先编辑文件/etc/sysconfig/network-scripts/ifcfg-bond0
DEVICE=bond0
TYPE=Ethernet
IPADDR=183.239.106.186
NETMASK=255.255.255.248
GATEWAY=183.239.106.185
ONBOOT=yes
BOOTPROTO=none
DNS1=114.114.114.114
然后编辑网卡1:/etc/sysconfig/network-scripts/ifcfg-eth0
TYPE=Ethernet
DEVICE=enp5s0f0
ONBOOT=yes
BOOTPROTO=none
USERCTL=no
MASTER=bond0
SLAVE=yes
编辑网卡2:/etc/sysconfig/network-scripts/ifcfg-eth1
TYPE=Ethernet
DEVICE=enp5s0f1
ONBOOT=yes
BOOTPROTO=none
USERCTL=no
MASTER=bond0
SLAVE=yes
设置完成后,重启network服务
service network restart # bond模块会自动加载
cat /proc/net/bonding/bond0 # 查看目前bonding的状态
modprobe -r bonding;service network restart # 让bond模式生效
最后查看bond0启动状态
cat /proc/net/bonding/bond0
ifconfig