# Linux ethernet bonding configuration


Software

# apt-get install ifenslave-2.6
# modprobe bonding
Bonding modes and switch configuration dependency

mode 0 (rr): etherchannel mode on
mode 1 (a-b): access port
mode 2 (xor): etherchannel mode on
mode 3 (broadcast): ¿?
mode 4 (LACP): etherchannel mode active
mode 5 (TLB): access port
mode 6 (ALB): access port

Balance-xor or mode 2

# cat /etc/network/interfaces
auto eth1
iface eth1 inet manual
 bond-master bond0

auto eth2
iface eth2 inet manual
 bond-master bond0

auto eth3
iface eth3 inet manual
 bond-master bond0

auto eth4
iface eth4 inet manual
 bond-master bond0

auto bond0
iface bond0 inet static
 address 192.168.5.69
 netmask 255.255.255.0
 network 192.168.5.0
 broadcast 192.168.5.255
 gateway 192.168.5.254
 dns-nameservers 192.168.125.100
 bond-slaves none
 bond-mode 2
 bond-miimon 100
 bond-use_carrier 1
 bond-downdelay 200
 bond-updelay 200
 bond-lacp-rate 0
 bond-xmit_hash_policy layer3+4
Switch(config)# port-channel load-balance src-dst-port
Switch(config)# interface range fa0/1-4
Switch(config-if-range)# channel-group 1 mode on
802.3ad or mode 4 (LACP)

# cat /etc/network/interfaces
auto eth1
iface eth1 inet manual
 bond-master bond0

auto eth2
iface eth2 inet manual
 bond-master bond0

auto eth3
iface eth3 inet manual
 bond-master bond0

auto eth4
iface eth4 inet manual
 bond-master bond0

auto bond0
iface bond0 inet static
 address 192.168.5.69
 netmask 255.255.255.0
 network 192.168.5.0
 broadcast 192.168.5.255
 gateway 192.168.5.254
 dns-nameservers 192.168.125.100
 bond-slaves none
 bond-mode 4
 bond-miimon 100
 bond-use_carrier 1
 bond-downdelay 200
 bond-updelay 200
 bond-lacp-rate 0
 bond-xmit_hash_policy layer2+3 # layer3-4 is not fully 802.3ad compliant
Switch(config)# port-channel load-balance src-dst-ip
Switch(config)# interface range fa0/1-4
Switch(config-if-range)# channel-group 1 mode active
Balance-tlb or mode 5 (Adaptive transmit load balancing)

# cat /etc/network/interfaces
auto eth1
iface eth1 inet manual
 bond-master bond0

auto eth2
iface eth2 inet manual
 bond-master bond0

auto eth3
iface eth3 inet manual
 bond-master bond0

auto eth4
iface eth4 inet manual
 bond-master bond0

auto bond0
iface bond0 inet static
 address 192.168.5.69
 netmask 255.255.255.0
 network 192.168.5.0
 broadcast 192.168.5.255
 gateway 192.168.5.254
 dns-nameservers 192.168.125.100
 bond-slaves none
 bond-mode 5
 bond-miimon 100
 bond-use_carrier 1
 bond-downdelay 200
 bond-updelay 35000
- No switch configuration needed.
- For each slave interface, the host sends three LLC frames per second, 60 bytes of size for each one.
- Each frame uses the MAC of the slave interface as source and destination address.
- The IP packets do not update the ARP table.
- From host view, packets are transmited for each slave interface and received only for one.
- Traffic received is influenced by sending ARP requests to hosts in the same VLAN.

Balance-alb or mode 6 (Adaptive load balancing)

# cat /etc/network/interfaces
auto eth1
iface eth1 inet manual
 bond-master bond0

auto eth2
iface eth2 inet manual
 bond-master bond0

auto eth3
iface eth3 inet manual
 bond-master bond0

auto eth4
iface eth4 inet manual
 bond-master bond0

auto bond0
iface bond0 inet static
 address 192.168.5.69
 netmask 255.255.255.0
 network 192.168.5.0
 broadcast 192.168.5.255
 gateway 192.168.5.254
 dns-nameservers 192.168.125.100
 bond-slaves none
 bond-mode 6
 bond-miimon 100
 bond-use_carrier 1
 bond-downdelay 200
 bond-updelay 35000
- No switch configuration needed.
- For each slave interface, the host sends three LLC frames per second, 60 bytes of size for each one.
- Each frame uses the MAC of the slave interface as source and destination address.
- The IP packets do not update the ARP table.
- From host view, packets are transmited and received for each slave interface.
- Traffic received is influenced by sending ARP requests to hosts in the same VLAN.

Reference

https://www.kernel.org/doc/Documentation/networking/bonding.txt

No comments: