Systemd-networkd-wait-online fails with bridged connection

Hello!
I have a small issue with my manjaro.
My setup consists of a manjaro installation with no gui (updated to the latest testing updates) as a host running virtual machines with qemu/kvm and libvirt.
Samba is installed in manjaro to access disks from virtual machines.
Network is configured as follows:

1: lo: <LOOPBACK,UP,LOWER_UP> mtu 65536 qdisc noqueue state UNKNOWN group default qlen 1000
    link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00
    inet 127.0.0.1/8 scope host lo
       valid_lft forever preferred_lft forever
    inet6 ::1/128 scope host 
       valid_lft forever preferred_lft forever
2: enp8s0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc fq_codel master br0 state UP group default qlen 1000
    link/ether 60:a4:4c:09:a7:2a brd ff:ff:ff:ff:ff:ff
3: enp9s0: <NO-CARRIER,BROADCAST,MULTICAST,UP> mtu 1500 qdisc fq_codel master br1 state DOWN group default qlen 1000
    link/ether 60:a4:4c:09:a7:2b brd ff:ff:ff:ff:ff:ff
4: br0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc noqueue state UP group default qlen 1000
    link/ether 36:a5:63:45:89:39 brd ff:ff:ff:ff:ff:ff
    inet 192.168.1.202/24 brd 192.168.1.255 scope global br0
       valid_lft forever preferred_lft forever
    inet6 fe80::34a5:63ff:fe45:8939/64 scope link 
       valid_lft forever preferred_lft forever
5: br1: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc noqueue state UP group default qlen 1000
    link/ether 4e:c0:e1:da:08:f3 brd ff:ff:ff:ff:ff:ff
    inet 192.168.2.1/24 brd 192.168.2.255 scope global br1
       valid_lft forever preferred_lft forever
    inet6 fe80::4cc0:e1ff:feda:8f3/64 scope link 
       valid_lft forever preferred_lft forever
6: vnet0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc noqueue master br0 state UNKNOWN group default qlen 1000
    link/ether fe:2a:14:55:1a:b2 brd ff:ff:ff:ff:ff:ff
    inet6 fe80::fc2a:14ff:fe55:1ab2/64 scope link 
       valid_lft forever preferred_lft forever
7: vnet1: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc noqueue master br1 state UNKNOWN group default qlen 1000
    link/ether fe:2a:14:32:2c:ff brd ff:ff:ff:ff:ff:ff
    inet6 fe80::fc2a:14ff:fe32:2cff/64 scope link 
       valid_lft forever preferred_lft forever

Interface enp8s0 is bridged to br0 and has internet access, br0 configured with a fixed ip address.
Interface enp9s0 is bridged to br1 without internet access, br1 configured with a fixed ip address and with no carrier.

br0 is used to have a internet connection inside virtual machines, br1 is used for samba transfers and in general for all the activities concerning virtual machines <–> host.

I noticed that sometimes, on boot, nmb service wasn’t starting, together with systemd-networkd-wait-online service and so the smb server.

systemd-networkd-wait-online log:

[root@tower tower]# systemctl status systemd-networkd-wait-online
  systemd-networkd-wait-online.service - Wait for Network to be Configured
     Loaded: loaded (/etc/systemd/system/systemd-networkd-wait-online.service; enabled; vendor preset: disabled)
     Active: failed (Result: exit-code) since Sun 2022-05-15 10:05:44 CEST; 6min ago
       Docs: man:systemd-networkd-wait-online.service(8)
    Process: 808 ExecStart=/usr/lib/systemd/systemd-networkd-wait-online (code=exited, status=1/FAILURE)
   Main PID: 808 (code=exited, status=1/FAILURE)
        CPU: 18ms

mag 15 10:05:24 tower systemd[1]: Starting Wait for Network to be Configured...
mag 15 10:05:44 tower systemd-networkd-wait-online[808]: Timeout occurred while waiting for network connectivity.
mag 15 10:05:44 tower systemd[1]: systemd-networkd-wait-online.service: Main process exited, code=exited, status=1/FAILURE
mag 15 10:05:44 tower systemd[1]: systemd-networkd-wait-online.service: Failed with result 'exit-code'.
mag 15 10:05:44 tower systemd[1]: Failed to start Wait for Network to be Configured.

However, if I boot manjaro and boot the vm “as soon as possible” all is well, systemd-networkd-wait-online doesn’t fail and also nmb and smb.

I think the culprit could be the bridged connection.
I don’t know if this could be considered a bug or not…
I tried to increase the timeout of systemd-networkd-wait-online without luck:

systemctl edit --full systemd-networkd-wait-online.service

ExecStart=/usr/lib/systemd/systemd-networkd-wait-online --timeout=20

Any help please?
Thank you for reading

This is wrong because timeout is in seconds: --timeout=1200 fixes it, because it loads and then waits for 20 minutes.
As soon as I start a vm systemd-networkd-wait-online activates.
So this is a fix, but still interested if this is the expected behaviour.

Thanks

Which software do you use to set it up. If you don’t use systemd-networkd , you should not use systemd-networkd-wait-online .

If you use systemd-networkd, you can edit the service. systemd-networkd-wait-online supports extra options that can ignore devices. See:
https://www.freedesktop.org/software/systemd/man/systemd-networkd-wait-online.service.html

1 Like

Thank you for your reply, I’m using both networkmanager and systemd-networkd (interfaces are configured with systemd-networkd, but I need also networkmanager for the cockpit package; I think I can run both, never read use one or the other).
Thank you also for the link, I read it and found that timeout is in seconds, I also read about the ignore option, but it doesn’t sound as a good fix, although I’m sure it will work also with the ignore option.
The description of ignore is:

Network interfaces to be ignored when deciding if the system is online

I wrote it doesn’t sound as a good fix because I want the system to fail if the br1 has some issue for whatever reason, different than having internet access (which will never have), if ignored I think the service will start the same, so the timeout option sounds better…

Using two high level network manager usually results in unexpected and non predictable behavior. But if you are able to use only one for your connection setups, it might work. Never done it myself.

An alternative would be to use the -i option and specify the operational status you want. You can use networkctl list to show the current operational status of all devices.

However, I probably would create my own wait-online service. The systemd-networkd-wait-online.service can be used as a template, I would just create my own script that check if everything is like I want and then succeeds or exits with an value greater than 0. The systemd-networkd-wait-online.service doesn’t do anything more, it is just wanted by network-online.target and if it fails the network-online.target is not reached.

1 Like

This topic was automatically closed 2 days after the last reply. New replies are no longer allowed.