(F40 KDE) Network bridge and NetworkManager-wait-online.service interaction

Edit: Originally I posted about systemd-networkd-wait-online. It is in fact NetworkManager-wait-online.service, sorry to everyone who spent their time answering my question, lol

I have a Fedora 40 KDE PC with one ethernet (Intel 2.5G) and WiFi. I want to use network bridge (so that other devices can access my libvirt VMs).

Using the KDE settings app, I deleted the default ethernet connection, then created a bridge connection (using the Intel 2.5G NIC as slave).

The bridge takes a lot time to boot up (~30 seconds). This causes the NetworkManager-wait-online.service to block me for 30 seconds before getting to the KDE login screen. I tried auto connecting the WiFi, but it doesn’t make NetworkManager-wait-online.service faster (maybe because it waits for all network devices to be up?).

I checked via systemd-analyze blame and is sure that NetworkManager-wait-online.service is the problem.

What can I do to make the bridge starts up faster? I have thought of disabling NetworkManager-wait-online.service, but I fear that it might cause some unintended consequences.

Just to confirm you are not using NetworkManager for connections?

I use systemd-networkd and do not see a delay bring up the bridge.

Here is my config for my desktop machine:

$ more /etc/systemd/network/*
::::::::::::::
/etc/systemd/network/bridge1.netdev
::::::::::::::
[NetDev]
Name=bridge1
Kind=bridge
::::::::::::::
/etc/systemd/network/bridge1.network
::::::::::::::
[Match]
Name=bridge1

[Network]
Description=Bridge one
DHCP=ipv4
Domains=mylocal.domain
::::::::::::::
/etc/systemd/network/internal.network
::::::::::::::
[Match]
MACAddress=xx:xx:xx:xx:xx:xx

[Network]
Bridge=bridge1

$ networkctl
IDX LINK    TYPE     OPERATIONAL SETUP
  1 lo      loopback carrier     unmanaged
  2 enp5s0  ether    enslaved    configured
  3 bridge1 bridge   routable    configured
  4 wlo1    wlan     off         unmanaged
2 Likes

I think I am using NetworkManager. I remember that since the bridge starts up so slow, I used nmcli to check, and nmcli con returned the network devices inside the KDE network settings.

If you are really using NetworkManager you should disable systemd-networkd-wait-online.service and enable NetworkManager-wait-online.service instead.

2 Likes

Thanks for you answer. I will check one more time to confirm which network daemon am I using.

I think I can symlink NetworkManager-wait-online.service to systemd-networkd-wait-online.service after disabling systemd-networkd-wait-online.service, so that the execution flow of other services are not changed.

Edit: Now that I think of it, the blocking service might actually be NetworkManager-wait-online.service. I am not at home and I only remember the wait-online.service part of the name of the service, sorry for the confusion

I don’t think this is necessary. Both of those wait-online services activate network-online.target. You can see which units depend on them with:

systemctl list-dependencies NetworkManager-wait-online.service --before
1 Like

Don’t do that. To enable a service, run systemctl enable NetworkManager-wait-online.service and it will do the right thing. Similar, systemctl disable systemd-networkd-wait-online.service to disable a service.

What you suggest above is the wrong thing to do and will not have the desired result.

2 Likes

Yep, turns out it is NetworkManager-wait-online.service which blocks me for 30 seconds, not systemd-networkd-wait-online.service. Very sorry :pray:

This is my config:

Bridged connection page:


IPv4:

Also, I noticed that if I manaully disconnect the bridge interface, then reconnect again, the slave 2.5G NIC won’t start by itself.

I have to manually start the 2.5G NIC with nmcli con up br0_enp6s0, otherwise the bridge interface just wait for it indefinitely. Not sure if this is relevant.

[SOLVED] Network start up delay / Networking, Server, and Protection / Arch Linux Forums

Found a potential solution in the Arch BBS, will test out later…

Edit: This is indeed the solution. It only takes about 1-2 seconds to boot after disabling STP…