How to change Currently Active Slave when runnning bonding in active-backup mode

When you are running bonding in active-backup mode, you can detect which slave is active by listing /proc/net/bonding/bond0. How to change active slave?


[root@rs01 ~]# cat /proc/net/bonding/bond0
Ethernet Channel Bonding Driver: v3.4.0 (October 7, 2008)

Bonding Mode: fault-tolerance (active-backup)
Primary Slave: None
Currently Active Slave: eth1
MII Status: up
MII Polling Interval (ms): 0
Up Delay (ms): 0
Down Delay (ms): 0
ARP Polling Interval (ms): 250
ARP IP target/s (n.n.n.n form): 10.0.0.1, 10.0.0.2, 10.0.0.3, 10.0.0.200

Slave Interface: eth1
MII Status: up
Link Failure Count: 2
Permanent HW addr: 00:1b:21:46:64:42

Slave Interface: eth0
MII Status: up
Link Failure Count: 2
Permanent HW addr: 00:24:81:26:c1:43

To switch to other slave, just remove active interface from bonding configuration

echo -eth1 > /sys/class/net/bond0/bonding/slaves

Bonding will continue with other interface, which becomes active. Now you can put interface eth1 back to bonding


echo +eth1 > /sys/class/net/bond0/bonding/slaves

10 thoughts on “How to change Currently Active Slave when runnning bonding in active-backup mode

  1. Thanks a lot! I avoided unnecessary restart of my proxmox host!

    Best regards!

    Marcin

  2. You might as well just bring the interface down so that failover can happen. This should work fine as the bond interface is in active-backup configuration.

  3. Consider a Clustered Database server so will it affect my cluster causing it to failover??? Will i loose network connection???

  4. If i have a Clustered Database and if I apply it on Active node will it failover??? Will i loose network connection??

Leave a Reply

Your email address will not be published. Required fields are marked *

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <s> <strike> <strong>