Setting up Round-Robin vs LACP (802.3ad) on Linux Systems


in this example we are setting up an aggregate on eth0,2,3 (not eth1 that is kept for other purposes).

look for options on how to setup the module,

modinfo bonding
modinfo bonding | grep mode
modinfo bonding | grep xmit

test-run the module already w/o options - while watching the logs

tail -F /var/log/messages &
lsmod | grep bonding
modprobe bonding
rmmod bonding

LACP on Slackware Linux

ls -lF /etc/rc.d/rc.modules
ls -lF /etc/rc.d/rc.modules.local #nothing about bonding
ls -lF /etc/modprobe.conf #noexist and DEPRECATED unless forced with -C
ls -lF /etc/modprobe.d/ #nothing about bonding
vi /etc/rc.d/rc.inet1

modprobe bonding
echo 100 > /sys/class/net/bond0/bonding/miimon
echo 200 > /sys/class/net/bond0/bonding/downdelay
echo 200 > /sys/class/net/bond0/bonding/updelay
#echo 0 > /sys/class/net/bond0/bonding/mode
echo 4 > /sys/class/net/bond0/bonding/mode
echo 1 > /sys/class/net/bond0/bonding/lacp_rate
#echo layer3+4 > /sys/class/net/bond0/bonding/xmit_hash_policy
echo +eth0 > /sys/class/net/bond0/bonding/slaves
echo +eth2 > /sys/class/net/bond0/bonding/slaves
echo +eth3 > /sys/class/net/bond0/bonding/slaves

finally proceed with network setup as usual or as a bridge but against the bond0 interface instead


echo -n cluster bridge...
brctl addbr clusterbr0
brctl addif clusterbr0 bond0
ifconfig bond0 mtu 9216 txqueuelen 9999 up
ifconfig clusterbr0 x.x.x.x/xx mtu 9216 txqueuelen 9999 up && echo done
ifconfig eth0 txqueuelen 3333 up
ifconfig eth2 txqueuelen 3333 up
ifconfig eth3 txqueuelen 3333 up

echo -n default bridge...
brctl addbr xenbr0
brctl addif xenbr0 eth1
ifconfig xenbr0 x.x.x.x/xx up && echo done
ifconfig eth1 up


setup the module,

vi /etc/modprobe.d/bonding.conf

alias bond0 bonding

set it up at boot time

systemctl stop NetworkManager
systemctl disable NetworkManager

cd /etc/sysconfig/network-scripts/
vi ifcfg-bond0


vi ifcfg-eth0


same for eth2,3.

tail -F /var/log/messages &
systemctl restart network

Ready to go

cat /sys/class/net/bonding_masters
cat /proc/net/bonding/bond0
cat /sys/class/net/bond0/bonding/miimon
cat /sys/class/net/bond0/bonding/downdelay
cat /sys/class/net/bond0/bonding/updelay
cat /sys/class/net/bond0/bonding/mode 
cat /sys/class/net/bond0/bonding/lacp_rate
cat /sys/class/net/bond0/bonding/xmit_hash_policy

Additional Notes

balance-rr may not be right however. Quoting NetBSD agr manual,

 link0   Use the round-robin distribution algorithm.  Don't use it unless
         you're really sure, because it violates the frame ordering rule.

Obsolete way to do things manually, for the record,

vi /etc/modprobe.d/bonding.conf 

alias bond0 bonding
options bond0 miimon=100 mode=4 lacp_rate=1

ifenslave -a
ifenslave bond0 eth0
ifenslave bond0 eth2
ifenslave bond0 eth3


Chapter 24. binding and bonding

Debian / Ubuntu Linux: Configure Network Bonding [ Teaming / Aggregating NIC ]

Dynamically changing the MTU of a Linux bridge interface

How to change MTU size for bonding interface ?

Setting MTU on bonded interface

nic bonding and jumbo frames