[Pkg-utopia-maintainers] Bug#983750: Bug#983750: networkmanager: NM takes over slave interfaces of bond

Michel Meyers debian at tcnnet.com
Mon Mar 1 12:59:18 GMT 2021


On 2021-03-01 12:22, Michael Biebl wrote:
> 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?

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



More information about the Pkg-utopia-maintainers mailing list