How to fix Ubuntu waiting for systemd-networkd-wait-online.service on startup

Problem

On boot, Ubuntu hangs for a long time (often up to 2 minutes) displaying a message such as:

boot.log
[  ***  ] A start job is running for Wait for Network to be Configured (1 min 30s / no limit)

This delay is caused by systemd-networkd-wait-online.service, which waits until all network interfaces managed by systemd-networkd are considered “online”. On systems where one or more interfaces never come up (e.g. an unused enp* interface, a disconnected cable, or a VM with a misconfigured bridge), the service keeps waiting until its timeout expires, blocking the rest of the boot process.

For most desktop and single-NIC server setups, the wait is unnecessary — the system can continue booting while the network finishes coming up in the background.

Solution

1. Disable and Mask the Service: Primary Fix

Stop the service from running during boot and mask it so dependent services cannot trigger it:

example.sh
sudo systemctl disable --now systemd-networkd-wait-online.service
sudo systemctl mask systemd-networkd-wait-online.service

To verify, run systemctl status systemd-networkd-wait-online.service and confirm that the status output displays loaded (masked...) and inactive (dead):

status.txt
● systemd-networkd-wait-online.service - Wait for Network to be Configured
     Loaded: loaded (/lib/systemd/system/systemd-networkd-wait-online.service; masked; vendor preset: enabled)
     Active: inactive (dead)

Masking (rather than just disabling) is important because some services declare a Wants= or Requires= dependency on systemd-networkd-wait-online.service. A masked unit cannot be activated by any other unit, so the wait is guaranteed not to run.

2. Alternative: Only Wait for Required Interfaces

If you do need the wait-online behavior but want to avoid the boot delay for interfaces that never come up, configure the service to wait only for specific interfaces instead of all of them:

example.sh
sudo systemctl edit systemd-networkd-wait-online.service

In the editor, add an override that limits the wait to the interfaces you actually care about (e.g. your primary NIC eth0):

/etc/systemd/system/systemd-networkd-wait-online.service.d/override.conf
[Service]
ExecStart=
ExecStart=/lib/systemd/systemd-networkd-wait-online --interface=eth0 --any

The empty ExecStart= line is required — it clears the original ExecStart before redefining it. The --any flag makes the service succeed as soon as the listed interface is online, rather than waiting for all interfaces.

Reload systemd and reboot to apply the change:

example.sh
sudo systemctl daemon-reload

3. Alternative: Reduce the Timeout

If you prefer to keep the service active but stop it from blocking the boot for too long, lower its timeout instead of disabling it:

example.sh
sudo systemctl edit systemd-networkd-wait-online.service
/etc/systemd/system/systemd-networkd-wait-online.service.d/override.conf
[Service]
TimeoutStartSec=5
example.sh
sudo systemctl daemon-reload

This keeps the wait-online guarantee but caps the delay at 5 seconds, so a missing interface only costs a few seconds of boot time instead of minutes.

References


Check out similar posts by category: Linux Ubuntu Systemd