Debian 11 (Bullseye) and the problem with bond (bonding) LACP interfaces

Written by - 0 comments

Published on September 1st 2021 - Listed in Linux Hardware Network


Back in June I did my first server tests with Debian 11 (Bullseye). Back then with Release Candidate 1, I realized something's off when using bonded interfaces, using 802.3ad or LACP bonding.

Trying bond-master config (from Debian Buster)

Basically the same bond interface config was taken from a Debian 10 (Buster) machine:

cka@buster:~$ cat /etc/network/interfaces
# This file describes the network interfaces available on your system
# and how to activate them. For more information, see interfaces(5).

source /etc/network/interfaces.d/*

# The loopback network interface
auto lo
iface lo inet loopback

# First interface enp3s0f0
auto enp3s0f0
iface enp3s0f0 inet manual
  bond-master bond0

# Second interface enp3s0f1
auto enp3s0f1
iface enp3s0f1 inet manual
  bond-master bond0

# Frontend bond interface
auto bond0
iface bond0 inet static
  address 192.168.100.4/24
  gateway 192.168.100.1
  bond-mode 802.3ad
  bond-miimon 100
  bond-lacp-rate 1

The bond interface is in this case defined in the physical interface stanzas: Both enp3s0f0 and enp3s0f1 interfaces point to a bond-master interface, bond0 in this case.

But using this config does not work in Debian 11!

Trying slaves (interfaces) config (from official documentation)

The official Debian bonding documentation mentions to define the physical interfaces on the bonding interface itself using the slaves keyword:

auto enp3s0f0
iface enp3s0f0 inet manual

auto enp3s0f1
iface enp3s0f1 inet manual

auto bond0
iface bond0 inet static
  address 192.168.100.4/24
  gateway 192.168.100.1
  slaves enp3s0f0 enp3s0f1
  bond-mode 802.3ad
  bond-miimon 100
  bond-downdelay 200
  bond-updelay 200

But this config does not work on Bullseye, either!

A (weird mix) but kind of working config

By testing multiple configuration options, I finally was able to get LACP working with the following config:

auto enp4s0f0
iface enp4s0f0 inet manual
  bond-master bond0

auto enp4s0f1
iface enp4s0f1 inet manual
  bond-master bond0

auto bond0
iface bond0 inet static
  address 192.168.100.4/24
  gateway 192.168.100.1
  bond-slaves none
  bond-mode 802.3ad
  bond-miimon 100
  bond-downdelay 200
  bond-updelay 200

Here both the bond-master interface is defined in the physical interfaces, yet on the bond interface itself bond-slaves is set to none.

This kinda worked - but it still is a weird workaround mixing up master and slave configuration.

Bug report 990428

Hence I opened up Debian bug report #990428, mainly because of two facts:

  • Existing bonding configuration (from Debian 10) would not work anymore -> regression
  • The (Debian) documented way of bonding configuration does not work either

My hope was obviously that this would be fixed before the official Debian 11 Bullseye release. But here we are, a few months later with Debian 11.0 released and with the same bug still in place :-(.

In the meantime Oleander Reis shared some insights why this happens. Debian 11 comes with a newer version (2.12) of the ifenslave package. This package contains the code which configures interface slaves to a bond interface. Unfortunately this newer version introduces a couple of issues concerning interface bonding, failing on "bond-master" configurations, for example:

Sep 01 15:58:23 bullseye ifup[1251]: No iface stanza found for master bond0
Sep 01 15:58:23 bullseye ifup[1249]: run-parts: /etc/network/if-pre-up.d/ifenslave exited with return code 1
Sep 01 15:58:23 bullseye ifup[1242]: ifup: failed to bring up enp3s0f0
Sep 01 15:58:23 bullseye ifup[1256]: No iface stanza found for master bond0
Sep 01 15:58:23 bullseye ifup[1254]: run-parts: /etc/network/if-pre-up.d/ifenslave exited with return code 1
Sep 01 15:58:23 bullseye ifup[1242]: ifup: failed to bring up enp3s0f1

Another important hint from Oleander was to remove the physical interface stanzas from /etc/network/interfaces (only keep bond interfaces).

Working bond interface config in Debian 11 Bullseye

Using this information from Oleander leads to the following config:

root@bullseye:~# cat /etc/network/interfaces
# This file describes the network interfaces available on your system
# and how to activate them. For more information, see interfaces(5).

source /etc/network/interfaces.d/*

# The loopback network interface
auto lo
iface lo inet loopback

# Frontend bond interface
auto bond0
iface bond0 inet static

  address 192.168.100.4/24
  gateway 192.168.100.1
  bond-slaves enp3s0f0 enp3s0f1
  bond-mode 802.3ad
  bond-miimon 100
  bond-lacp-rate 1

Note: There are no physical interfaces (enp3s0f0 and enp3s0f1) defined in the interfaces file!

This works surprisingly well, and systemctl status networking shows everything OK:

root@bullseye:~# systemctl status networking
- networking.service - Raise network interfaces
     Loaded: loaded (/lib/systemd/system/networking.service; enabled; vendor preset: enabled)
     Active: active (exited) since Wed 2021-09-01 16:07:52 CEST; 50min ago
       Docs: man:interfaces(5)
    Process: 688 ExecStart=/sbin/ifup -a --read-environment (code=exited, status=0/SUCCESS)
   Main PID: 688 (code=exited, status=0/SUCCESS)
        CPU: 135ms

Sep 01 16:07:51 bullseye systemd[1]: Starting Raise network interfaces...
Sep 01 16:07:52 bullseye systemd[1]: Finished Raise network interfaces.

And the bond interface is correctly up, which can be checked using /proc/net/bonding/bond0:

root@bullseye:~# cat /proc/net/bonding/bond0
Ethernet Channel Bonding Driver: v5.10.0-8-amd64

Bonding Mode: IEEE 802.3ad Dynamic link aggregation
Transmit Hash Policy: layer2 (0)
MII Status: up
MII Polling Interval (ms): 100
Up Delay (ms): 0
Down Delay (ms): 0
Peer Notification Delay (ms): 0

802.3ad info
LACP rate: fast
Min links: 0
Aggregator selection policy (ad_select): stable
System priority: 65535
System MAC address: XX:XX:XX:XX:XX:XX
Active Aggregator Info:
    Aggregator ID: 2
    Number of ports: 2
    Actor Key: 9
    Partner Key: 32787
    Partner Mac Address: XX:XX:XX:XX:XX:XX

Slave Interface: enp3s0f0
MII Status: up
Speed: 1000 Mbps
Duplex: full
Link Failure Count: 1
Permanent HW addr: XX:XX:XX:XX:XX:XX
Slave queue ID: 0
Aggregator ID: 2
Actor Churn State: none
Partner Churn State: none
Actor Churned Count: 0
Partner Churned Count: 0
details actor lacp pdu:
    system priority: 65535
    system mac address: XX:XX:XX:XX:XX:XX
    port key: 9
    port priority: 255
    port number: 1
    port state: 63
details partner lacp pdu:
    system priority: 32667
    system mac address: XX:XX:XX:XX:XX:XX
    oper key: 32787
    port priority: 32768
    port number: 16659
    port state: 61

Slave Interface: enp3s0f1
MII Status: up
Speed: 1000 Mbps
Duplex: full
Link Failure Count: 0
Permanent HW addr: XX:XX:XX:XX:XX:XX
Slave queue ID: 0
Aggregator ID: 2
Actor Churn State: none
Partner Churn State: none
Actor Churned Count: 0
Partner Churned Count: 0
details actor lacp pdu:
    system priority: 65535
    system mac address: XX:XX:XX:XX:XX:XX
    port key: 9
    port priority: 255
    port number: 2
    port state: 63
details partner lacp pdu:
    system priority: 32667
    system mac address: XX:XX:XX:XX:XX:XX
    oper key: 32787
    port priority: 32768
    port number: 275
    port state: 61


Add a comment

Show form to leave a comment

Comments (newest first)

No comments yet.