Have spent few days after Debian 10 buster upgrade (full-upgrade) to Debian 11 Bullseye, so want to share the bonding issue solution.
After Debian Linux upgrade, existing trunk configuration is not working anymore. There are breaking changes, referred as bugs:
And previously on Debian 10 working bond0 configuration was like this:
cat /etc/network/interfaces.d/bond0
auto enp9s0f0
iface enp9s0f0 inet manual
bond-master bond0
bond-mode 4
auto enp9s0f1
iface enp9s0f1 inet manual
bond-master bond0
bond-mode 4
auto bond0
iface bond0 inet static
address 192.168.23.1
network 192.168.23.0
netmask 255.255.255.128
bond-slaves none
bond-miimon 100
bond-lacp-rate 1 # 'fast' detection, every 1s, instead of 'slow', every 30s
# bond-updelay 100 # optional, mostly for debugging
# bond-downdelay 100 # optional, mostly for debugging
bond-xmit-hash-policy layer2+3 # optional, sets the bonding algorithm
which resulted in no bond0 configured or even errors like these:
RTNETLINK answers: Cannot assign requested address
run-parts: /etc/network/if-pre-up.d/ifenslave exited with return code 1
networking.service: Main process exited, code=exited, status=1/FAILURE
or
journalctl -n -u networking
showing error line
No iface stanza found for master
where 'stanza' is so called module configuration, term used by developers.
The root cause of that is the ifenslave
package was refactored a lot, main idea was to remove the "stanza" from child items, which are physical interfaces (nic), and keep it all in one place, e.g. bond interface it self.
Also even in ifenslave
version 1.22 bug left, referring to nonexistent command ifstate
in Debian 11. Easy and quick fix is:
sed -i 's/ifstate -l/ip link show dev/g' /etc/network/if-pre-up.d/ifenslave
Even after fixing this, bonding does not work, this means there are bugs of issues why bonding is not working on Bullseye.
Going through the code I found that the key change was not only to remove bond-mode
from child and put it back to bond interface configuration, like it was in early package days, but also revert back to the early format of bond-slaves
.
Thus working Debian 11 Bullseye bonding configuration file looks like this:
cat /etc/network/interfaces.d/bond0
auto enp9s0f0
iface enp9s0f0 inet manual
bond-master bond0
auto enp9s0f1
iface enp9s0f1 inet manual
bond-master bond0
auto bond0
iface bond0 inet static
address 192.168.23.1
network 192.168.23.0
netmask 255.255.255.128
bond-mode 4
bond-slaves enp9s0f0 enp9s0f1
bond-miimon 100
bond-lacp-rate 1 # 'fast' detection, every 1s, instead of 'slow', every 30s
# bond-updelay 100 # optional, mostly for debugging
# bond-downdelay 100 # optional, mostly for debugging
bond-xmit-hash-policy layer2+3 # optional, sets the bonding algorithm
Update 2022:
Recently on one of metal servers I got issue, that after kernel upgrade and removal of old kernel, system become networkless.
Long story short - there can be case, that bonding kernel module is not loaded, not present, or any loading failure because of version mix up, or initrd mess-up. Check that with:
lsmod | grep bond
bonding 167936 0
If it's not there, this is a culprit of the problem. Try to load module manually modprobe bonding
and check if it loads. Investigate does loaded kernel version corresponds to what is supposed to be uname -r
and check if modules directory is present for that version.
Reference: https://www.kernel.org/doc/Documentation/networking/bonding.txt
bond_mode 802.3ad
butbond-mode 802.3ad
.