Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Bug#983750: networkmanager: NM takes over slave interfaces of bond

112 views
Skip to first unread message

Michel Meyers

unread,
Mar 1, 2021, 4:10:05 AM3/1/21
to
Package: networkmanager
Severity: normal

Dear Maintainer,

I had a bond configured as described in Example 1 on: https://wiki.debian.org/Bonding

This morning, my server's bond interface showed down, and its slaves
kept getting removed. After some digging, I found that networkmanager
had gotten installed and a check in nmcli showed that it had taken over each of the slave interfaces
while listing bond0 as unmanaged.

It appears that NM ignores the "slaves eth0 eth1" directive in
/etc/network/interfaces so unless each of the interfaces is specifically
named as in Example 2, NM takes over the slaves, killing the bond.

- Michel



-- System Information:
Debian Release: bullseye/sid
APT prefers testing
APT policy: (650, 'testing'), (600, 'unstable')
Architecture: amd64 (x86_64)
Foreign Architectures: i386

Kernel: Linux 5.10.0-3-amd64 (SMP w/12 CPU threads)
Kernel taint flags: TAINT_PROPRIETARY_MODULE, TAINT_OOT_MODULE, TAINT_UNSIGNED_MODULE
Locale: LANG=en_US.UTF-8, LC_CTYPE=en_US.UTF-8 (charmap=UTF-8), LANGUAGE not set
Shell: /bin/sh linked to /bin/bash
Init: systemd (via /run/systemd/system)
LSM: AppArmor: enabled

Andrei POPESCU

unread,
Mar 1, 2021, 4:50:04 AM3/1/21
to
Control: reassign -1 network-manager
Reassigning to correct package.

Kind regards,
Andrei
--
Looking after bugs assigned to unknown or inexistent packages
signature.asc

Michael Biebl

unread,
Mar 1, 2021, 5:40:03 AM3/1/21
to
Am 01.03.21 um 10:41 schrieb Andrei POPESCU:
> Control: reassign -1 network-manager
>
> On Lu, 01 mar 21, 10:00:26, Michel Meyers wrote:
>> Package: networkmanager
>> Severity: normal
>>
>> Dear Maintainer,
>>
>> I had a bond configured as described in Example 1 on: https://wiki.debian.org/Bonding
>>
>> This morning, my server's bond interface showed down, and its slaves
>> kept getting removed. After some digging, I found that networkmanager
>> had gotten installed and a check in nmcli showed that it had taken over each of the slave interfaces
>> while listing bond0 as unmanaged.
>>
>> It appears that NM ignores the "slaves eth0 eth1" directive in
>> /etc/network/interfaces so unless each of the interfaces is specifically
>> named as in Example 2, NM takes over the slaves, killing the bond.

If you want to prevent NM to "auto" manage your devices, you could use
/usr/share/doc/network-manager/examples/server.conf (copy it to
/etc/NetworkManager/conf.d/)


Alternative, you can tell NM explicitly which devices it should ignore.
See man NetworkManager.conf → unmanaged-devices

OpenPGP_signature

Michel Meyers

unread,
Mar 1, 2021, 6:10:03 AM3/1/21
to
I don't normally use NM and don't have it installed. It must've gotten
pulled in as a dependency of some package (my fault for not catching it
really) and the nightly systemd restart of services then somehow caused
it to take over.

I have now created [device] sections declaring the slaves as managed=0
in the NetworkManager.conf (left over after uninstalling NM), but anyone
with the same config as me making the same mistake of inadvertently
installing NM will land in the same weird situation where their bond0
interface is up but not getting its slaves. (I've also started looking
at specifically declaring the slave interfaces in
/etc/network/interfaces, but not had success with that so far as it
stops the bond0 interface from coming up correctly. "Example 2" from the
docs seems broken here ... more debugging to be done.)

- Michel

Michael Biebl

unread,
Mar 1, 2021, 6:30:04 AM3/1/21
to
Am 01.03.21 um 11:56 schrieb Michel Meyers:
> I have now created [device] sections declaring the slaves as managed=0
> in the NetworkManager.conf (left over after uninstalling NM), but anyone
> with the same config as me making the same mistake of inadvertently
> installing NM will land in the same weird situation where their bond0
> interface is up but not getting its slaves. (I've also started looking
> at specifically declaring the slave interfaces in
> /etc/network/interfaces, but not had success with that so far as it
> stops the bond0 interface from coming up correctly. "Example 2" from the
> docs seems broken here ... more debugging to be done.)

Trying to parse and interpret /etc/network/interfaces in NetworkManager
is a losing battle I fear.

We have some support to understand basic ifupdown configurations, but
it's incomplete and buggy.

Can you share your /e/n/i?

OpenPGP_signature

Michel Meyers

unread,
Mar 1, 2021, 8:10:03 AM3/1/21
to
Sure:

------
# /etc/network/interfaces -- configuration file for ifup(8), ifdown(8)

# The loopback interface
auto lo
iface lo inet loopback

# The first network card - this entry was created during the Debian
installation
# (network, broadcast and gateway are optional)
#auto eth0
auto bond0
iface bond0 inet static
address 192.168.1.2
netmask 255.255.255.0
gateway 192.168.1.1
mtu 9000
slaves ens6 eth1
bond-mode active-backup
bond-miimon 100
bond-downdelay 200
bond-updelay 200
post-up route add 192.168.0.1 gw 192.168.1.147 && ip route add
1.1.1.1 via 192.168.1.11 && ip route add 1.0.0.1 via 192.168.1.12
pre-down route del 192.168.0.1 gw 192.168.1.147 && ip route del
1.1.1.1 via 192.168.1.11 && ip route del 1.0.0.1 via 192.168.1.12
iface bond0 inet6 auto
privext 2

auto bond0:0
allow-hotplug bond0:0
iface bond0:0 inet static
address 192.168.1.5
netmask 255.255.255.0
iface bond0:0 inet6 auto
privext 2
------

My guess is that the fact that there's no iface definition for the
slaves (ens6 and eth1) caused them to be taken over by NM. (The only
indication NM could've had to avoid them is the "slaves" stanza within
the bond0 iface definition.)

I've since tried to re-define them like this:

------
# /etc/network/interfaces -- configuration file for ifup(8), ifdown(8)

# The loopback interface
auto lo
iface lo inet loopback

# The first network card - this entry was created during the Debian
installation
# (network, broadcast and gateway are optional)
#auto eth0
auto bond0
iface bond0 inet static
address 192.168.1.200
netmask 255.255.255.0
gateway 192.168.1.1
mtu 9000
bond-slaves ens6 eth1
bond-primary ens6
bond-mode active-backup
bond-miimon 100
bond-downdelay 200
bond-updelay 200
post-up route add 192.168.0.1 gw 192.168.1.1 && ip route add
1.1.1.1 via 192.168.1.11 && ip route add 1.0.0.1 via 192.168.1.12
pre-down route del 192.168.0.1 gw 192.168.1.1 && ip route del
1.1.1.1 via 192.168.1.11 && ip route del 1.0.0.1 via 192.168.1.12
iface bond0 inet6 auto
privext 2

auto ens6
allow-bond ens6
iface ens6 inet manual
bond-master bond0

auto eth1
allow-bond eth1
iface eth1 inet manual
bond-master bond0

auto bond0:0
allow-hotplug bond0:0
iface bond0:0 inet static
address 192.168.1.5
netmask 255.255.255.0
iface bond0:0 inet6 auto
privext 2
------

But that fails with:
------
Mar 1 10:15:07 server ifup[69522]: No iface stanza found for master
bond0
Mar 1 10:15:07 server ifup[69518]: run-parts:
/etc/network/if-pre-up.d/ifenslave exited with return code 1
Mar 1 10:15:07 server ifup[69516]: ifup: failed to bring up ens6
------

I have yet to figure out why the ifenslave check fails. (Seems to be
running 'ifstate -l "$IF_BOND_MASTER"': ifstate is not a command that's
in my path and the only ifstate script that I found in
/usr/share/doc/ifupdown/contrib/ifstate doesn't take -l as a parameter.
Maybe some package versions are out of sync on my system.)


tl;dr: If it's easy to catch the 'slaves' stanza in /e/n/i and have NM
consider the specified slaves as unmanaged, that would be nice, but the
occurrence of this issue is admittedly very rare and thus may not be
worth the effort.

- Michel

Michael Biebl

unread,
Mar 1, 2021, 10:10:03 AM3/1/21
to
Am 01.03.21 um 13:59 schrieb Michel Meyers:

> # /etc/network/interfaces -- configuration file for ifup(8), ifdown(8)
>
> # The loopback interface
> auto lo
> iface lo inet loopback
>
> # The first network card - this entry was created during the Debian
> installation
> # (network, broadcast and gateway are optional)
> #auto eth0
> auto bond0
> iface bond0 inet static
>         address 192.168.1.2
>         netmask 255.255.255.0
>         gateway 192.168.1.1
>         mtu 9000
>         slaves ens6 eth1



Reading https://www.commandlinux.com/man-page/man5/interfaces.5.html ,
it appears "slave" is no native ifupdown config stanza.
I suppose it is implemented by a third party package?
Which brings me back to my concern, that this is really a losing battle,
since the interfaces file format is not specified in a way, which would
make it easy to gather all managed interfaces.

We already special case "bridge-ports" [1], and maybe we could extend
that to also consider "slaves". But I really don't like that we don't
have a proper API here.
Maybe you could convince the ifupdown maintainer to provide such an API,
e.g. via "ifquery", where we could query all interfaces that are managed
by ifupdown.

Regards,
Michael



[1]
https://gitlab.freedesktop.org/NetworkManager/NetworkManager/-/blob/master/src/core/settings/plugins/ifupdown/nms-ifupdown-plugin.c#L255

OpenPGP_signature

Michel Meyers

unread,
Mar 2, 2021, 2:00:04 PM3/2/21
to
On 2021-03-01 16:02, Michael Biebl wrote:
> Am 01.03.21 um 13:59 schrieb Michel Meyers:
>
>> # /etc/network/interfaces -- configuration file for ifup(8), ifdown(8)
>>
>> # The loopback interface
>> auto lo
>> iface lo inet loopback
>>
>> # The first network card - this entry was created during the Debian
>> installation
>> # (network, broadcast and gateway are optional)
>> #auto eth0
>> auto bond0
>> iface bond0 inet static
>>          address 192.168.1.2
>>          netmask 255.255.255.0
>>          gateway 192.168.1.1
>>          mtu 9000
>>          slaves ens6 eth1
>
>
>
> Reading https://www.commandlinux.com/man-page/man5/interfaces.5.html ,
> it appears "slave" is no native ifupdown config stanza.
> I suppose it is implemented by a third party package?

Guessing its Debian specific? I got it from here:

https://wiki.debian.org/Bonding#Configuration_-_Example_1

- Michel

Michael Biebl

unread,
Mar 2, 2021, 2:00:05 PM3/2/21
to
Am 02.03.21 um 19:46 schrieb Michel Meyers:
Ok, seems this is not a native ifupdown config stanza but "implemented"
by the ifenslave package.


OpenPGP_signature

Mohamed Abdou

unread,
Jul 22, 2022, 5:30:03 AM7/22/22
to

My good friend,

My name is Mohamed Abdou and I am the manager of the United Bank of Africa. Last week I emailed you business and investment proposals. Did you get my message last week? .

Please contact me and let me know if you received it or not.

Hope to hear from you soon.


Have a good day.

Mr. Mohammed Abdou
0 new messages