centos7系统,双网卡绑定操作:
#关闭NetworkManager服务,并禁止开机启动
systemctl stop NetworkManager.service
systemctl disable NetworkManager.service
#设置绑定后网口IP信息
vi /etc/sysconfig/network-scripts/ifcfg-bond0
DEVICE=bond0
TYPE=Bond
IPADDR=10.10.10.2 绑定IP
NETMASK=255.255.255.0
GATEWAY=10.10.10.1
DNS1=10.10.10.10
USERCTL=no
BOOTPROTO=none
ONBOOT=yes
BONDING_MASTER=yes
设置需要绑定的网卡1,需替换为实际网卡
vi /etc/sysconfig/network-scripts/ifcfg-ens1f0
BOOTPROTO=none
#UUID=6403e722-84af-4ff3-a7b8-719d8926272d
DEVICE=ens1f0
ONBOOT=yes
USERCTL=no
MASTER=bond0
SLAVE=yes
设置需要绑定的网卡2,需替换为实际网卡
vi /etc/sysconfig/network-scripts/ifcfg-ens1f1
BOOTPROTO=none
#UUID=6403e722-84af-4ff3-a7b8-719d8926272d
DEVICE=ens1f0
ONBOOT=yes
USERCTL=no
MASTER=bond0
SLAVE=yes
#设置绑定的模式,例子为bond0
vi /etc/modprobe.d/bond.conf
alias bond0 bonding
options bond0 miimon=100 mode=0
xmit_hash_policy=layer3+4
#重启网络服务
systemctl restart network
ethtool bond0 查看网速
ethtool -p bond0