您的位置:首页 > 运维架构 > Linux

RedHat / CentOS:如何在线更改当前网口 Slave的状态(bonding mode)

2017-09-12 16:03 981 查看
ifenslave 命令可用于连接或分离或更改当前活动的从接口与绑定。 现在,将主从接口更改

ifenslave -c bond0 em1


再次检查绑定状态以确保em1是新的active slave

cat /proc/net/bonding/bond0


Ethernet Channel Bonding Driver: v3.7.1 (April 27, 2011)

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

Slave Interface: em0 MII Status: up Speed: 1000 Mbps Duplex: full Link Failure Count: 0 Permanent HW addr: 00:21:28:b2:65:26 Slave queue ID: 0

Slave Interface: em1 MII Status: up Speed: 1000 Mbps Duplex: full Link Failure Count: 0 Permanent HW addr: 00:21:28:b2:65:27 Slave queue ID: 0

增加新的 slave interface

ifenslave bond0 em2


删除旧的 slave interface

ifenslave -d bond0 em0


查看bond0:

cat /proc/net/bonding/bond0


Ethernet Channel Bonding Driver: v3.7.1 (April 27, 2011)

Bonding Mode: fault-tolerance (active-backup)

Primary Slave: None

Currently Active Slave: em1

MII Status: up

MII Polling Interval (ms): 100

Up Delay (ms): 5000

Down Delay (ms): 5000

Slave Interface: em1

MII Status: up

Speed: 1000 Mbps

Duplex: full

Link Failure Count: 0

Permanent HW addr: 00:21:28:b2:65:27

Slave queue ID: 0

Slave Interface: em2

MII Status: up

Speed: 1000 Mbps

Duplex: full

Link Failure Count: 0

Permanent HW addr: 00:29:3a:c1:63:71

Slave queue ID: 0

做永久保存

rm /etc/sysconfig/network-scripts/ifcfg-em0
vi /etc/sysconfig/network-scripts/ifcfg-em2


DEVICE=em2

BOOTPROTO=none

ONBOOT=yes

MASTER=bond0

SLAVE=yes

保存退出即可
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签:  red hat centos linux bonding