Sobes.tech
Junior — Middle

What methods can be used to configure network interface aggregation (Bonding) in Linux to improve reliability and bandwidth?

sobes.tech AI

Answer from AI

In Linux, network interface aggregation (bonding) allows combining multiple physical interfaces into one logical interface to improve reliability and bandwidth. The main configuration methods are:

  1. Using the bonding kernel module

    • A virtual interface bond0 is created
    • Physical interfaces are added to it
    • The aggregation mode (mode) is configured
  2. Bonding modes:

    • balance-rr (Round-robin) — distributes packets across all interfaces, increasing bandwidth
    • active-backup — one active interface, others in reserve, increasing reliability
    • 802.3ad (LACP) — dynamic aggregation with switch support
    • Other modes: balance-xor, broadcast, etc.
  3. Configuration via configuration files (e.g., in /etc/network/interfaces or through NetworkManager)

Example of bonding configuration with mode=active-backup:

modprobe bonding
ip link add bond0 type bond
ip link set eth0 down
ip link set eth1 down
ip link set eth0 master bond0
ip link set eth1 master bond0
ip link set bond0 up
ip link set eth0 up
ip link set eth1 up
echo active-backup > /sys/class/net/bond0/bonding/mode
  1. Using LACP (802.3ad) requires support from the switch and proper parameter configuration.

Thus, the choice of mode and configuration method depends on the requirements for network fault tolerance and bandwidth.