CentOS 7 配置端口bonding

1、配置两个万兆网卡绑定

cd /etc/sysconfig/network-scripts/

mkdir bak
mv ifcfg-p3* bak

echo "DEVICE=bond0
TYPE=Ethernet
ONBOOT=yes
BOOTPROTO=static
IPADDR=100.1.2.41
PREFIX=24
GATEWAY=100.1.2.254
BONDING_OPTS=\"miimon=100 mode=1\"
USERCTL=no" > ifcfg-bond0

echo "DEVICE=p3p1
BOOTPROTO=none
ONBOOT=yes
USERCTL=no
SLAVE=yes
MASTER=bond0" > ifcfg-p3p1

echo "DEVICE=p3p2
BOOTPROTO=none
ONBOOT=yes
USERCTL=no
SLAVE=yes
MASTER=bond0" >> ifcfg-p3p2

service NetworkManager stop 
chkconfig NetworkManager off
service network restart

2、验证网卡绑定

cat /proc/net/bonding/bond0
ethtool bond0
ifconfig bond0

点赞

发表评论

电子邮件地址不会被公开。必填项已用 * 标注