CentOS 7.6网卡绑定mode1

CentOS 7.6网卡绑定mode1

[root@server ~]# systemctl stop NetworkManager
[root@server ~]# systemctl disable NetworkManager
[root@server ~]# lsmod |grep bonding
[root@server ~]# modprobe --first-time bonding
[root@server ~]# setenforce 0
[root@server ~]# getenforce 0

使用bond实现mode1:
[root@server ~]# more /etc/modprobe.d/bond.conf
alias bond1 bonding
options bond1 miimon=100 mode=1
[root@server ~]#

[root@server network-scripts]# more ifcfg-bond1
TYPE=Bond
BOOTPROTO=none
ONBOOT=yes
USERCTL=no
DEVICE=bond1
IPADDR=192.168.21.200
PREFIX=24
NM_CONTROLLE=no
BONDING_MASTER=yes
BONDING_OPTS="mode=1 miimon=100"
[root@server network-scripts]#
[root@server network-scripts]# more ifcfg-ens33
TYPE="Ethernet"
BOOTPROTO="none"
NAME="ens33"
DEVICE="ens33"
ONBOOT="yes"
MASTER=bond1
SLAVE=yes
USERCTL=no
[root@server network-scripts]#
[root@server network-scripts]# more ifcfg-ens36
TYPE="Ethernet"
BOOTPROTO="none"
NAME="ens36"
DEVICE="ens36"
ONBOOT="yes"
MASTER=bond1
SLAVE=yes
USERCTL=no
[root@server network-scripts]#

验证:

1.查看bond1状态:
[root@server network-scripts]# cat /proc/net/bonding/bond1
Ethernet Channel Bonding Driver: v3.7.1 (April 27, 2011)

Bonding Mode: fault-tolerance (active-backup)
Primary Slave: None
Currently Active Slave: ens33
MII Status: up
MII Polling Interval (ms): 100
Up Delay (ms): 0
Down Delay (ms): 0

Slave Interface: ens33
MII Status: up
Speed: 1000 Mbps
Duplex: full
Link Failure Count: 2
Permanent HW addr: 00:0c:29:a6:22:fe
Slave queue ID: 0

Slave Interface: ens36
MII Status: up
Speed: 1000 Mbps
Duplex: full
Link Failure Count: 1
Permanent HW addr: 00:0c:29:a6:22:08
Slave queue ID: 0
[root@server network-scripts]#
CentOS 7.6网卡绑定mode1

2.测试,宕掉其中一个接口,看是否切换
[root@server network-scripts]# ifdown ens36
[root@server network-scripts]# cat /proc/net/bonding/bond1
Ethernet Channel Bonding Driver: v3.7.1 (April 27, 2011)

Bonding Mode: fault-tolerance (active-backup)
Primary Slave: None
Currently Active Slave: ens33
MII Status: up
MII Polling Interval (ms): 100
Up Delay (ms): 0
Down Delay (ms): 0

Slave Interface: ens33
MII Status: up
Speed: 1000 Mbps
Duplex: full
Link Failure Count: 2
Permanent HW addr: 00:0c:29:a6:22:fe
Slave queue ID: 0
[root@server network-scripts]#

3.查看网卡绑定后的速度:
[root@server network-scripts]# ethtool bond1
Settings for bond1:
Supported ports: [ ]
Supported link modes: Not reported
Supported pause frame use: No
Supports auto-negotiation: No
Supported FEC modes: Not reported
Advertised link modes: Not reported
Advertised pause frame use: No
Advertised auto-negotiation: No
Advertised FEC modes: Not reported
Speed: 1000Mb/s
Duplex: Full
Port: Other
PHYAD: 0
Transceiver: internal
Auto-negotiation: off
Link detected: yes
[root@server network-scripts]#
CentOS 7.6网卡绑定mode1

转载于:https://blog.51cto.com/huazhixu123/2342950

  • 0
    点赞
  • 2
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值