Linux supports bonding of multiple Ethernet network interfaces for extra reliability or load balancing.

Bonding driver used to be configured via ifenslave command, which has been deprecated (superseded by ip command from iproute2 toolkit), so ifenslave was removed from the kernel sources.

One particular feature of deprecated command which I can't find a modern equivalent for is changing an active slave of the bonding interface (assuming that bonding interface is operating in the active-backup mode).

For example, the following commands set eth0 network card as an active slave of bond0 interface:

ifenslave -c bond0 eth0
ifenslave --change-active bond0 eth0

Is there a way to change an active slave of Linux bonding interface using ip command from the iproute2 toolkit or, alternatively, via sysfs?

1 Answer 1


Create procedure for bonding interface:

# create the bonding interface with active-backup mode
ip link add name bond0 type bond mode active-backup

# add the under laying interfaces
# the interface, that has been added first, will be active
ip link set master bond0 dev eth1
ip link set master bond0 dev eth0

# enable the bonding interface
ip link set up dev bond0
ip address add dev bond0

# check the results: detailed info and statistics of bond0
ip -s -s -d link ls dev bond0

# check the state of ALL under laying interfaces
# with statistics and details 
ip -s -s -d link ls master bond0

# check the kernel logs
journalctl -kn 20

To change the active link for bonding device you should use this command:

ip link set dev bond0 type bond active_slave eth0

If you have gotten the error like RTNETLINK answers: invalid argument then check the dmesg or the journalctl -k outputs.

For brief help for options you can use ip link add type bond help command. It applies to any link type.

All values of current options of bond0 interface you can get with ip -d l ls dev bond0 command.

  • thank you for that high quality answer. this helped me in an emergency restore where the wrong bond interface was active and limiting restore rate. now people will have their data back a bit faster, which just makes the world better. Dec 6, 2023 at 16:49

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .