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?
Best Answer
Create procedure for bonding interface:
To change the active link for bonding device you should use this command:
If you have gotten the error like
RTNETLINK answers: invalid argument
then check thedmesg
or thejournalctl -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 withip -d l ls dev bond0
command.