Question: How can we change the network bonding configuration from one mode to another?
Steps to change the network bonding configuration.
Temporarily Change the Bonding Mode
In this case, this changes the bonding mode in the running system configuration, but not permanently.
Step 1: Check the current mode set:
# cat /sys/class/net/bond0/bonding/mode
Step 2: Bring down the bonded interface(ex: bond0):
# ifdown bond0
Step 3: Change the Bonding Mode:
# echo 4 > /sys/class/net/bond0/bonding/mode ### for Active - Active mode
Step 4: Check back the current bond status:
# cat /sys/class/net/bond0/bonding/mode 802.3ad 4
Step 5: Bring up the bonded interface:
#ifup bond0
Permanently Change the Bonding Mode
In this case, the changes to the bonding mode are persistent across a reboot.
Step 1: Edit the configuration file with new mode value:
# vim /etc/sysconfig/network-scripts/ifcfg-bondeth0
Step 2: Change the bonding mode:
BONDING_OPTS="mode=active-backup miimon=100 downdelay=5000 updelay=5000 num_grat_arp=100" ### from Active - Backup
to
BONDING_OPTS="mode=4 miimon=100 downdelay=5000 updelay=5000 num_grat_arp=100" ### Active - Active mode
Save and quit the file.
Step 3: Bring up the bonded interface:
# ifup bondeth0
The same steps can be used for changing any one of the modes to the another.