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

Introduction

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

Common

look for options on how to setup the module,

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

setup the module,

vi /etc/modprobe.d/bonding.conf

alias bond0 bonding

load it already while watching the logs,

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

RHEL/CentOS 7

systemctl stop NetworkManager
systemctl disable NetworkManager

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

NAME=bond0
DEVICE=bond0
IPADDR=IP_ADDRESS
PREFIX=24
ONBOOT=yes

vi ifcfg-eth0

NAME=eth0
DEVICE=eth0
MASTER=bond0
SLAVE=yes
ONBOOT=yes

same for eth2,3.

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

Slackware Linux

LACP,

rm -f /etc/modprobe.d/bonding.conf

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

Notes.

Finally proceed with network setup as usual but yet against the bond0 interface.

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

References


Nethence | Doc | Pub | Lab | Pbraun | SNE Russia | xhtml