During system boot on Ubuntu (particularly on Ubuntu Server, cloud virtual machines, or multi-NIC workstations), your console screen may hang for two minutes or more before displaying the red error banner: “Failed to start Wait for Network to be Configured” (service unit systemd-networkd-wait-online.service). While the system eventually finishes booting, the boot delay is immense.
This failure occurs because systemd-networkd-wait-online.service is configured by default to wait until all configured network interfaces reach a fully operational and routable state before allowing the boot process to continue. If your machine possesses multiple network ports (such as an unused secondary Ethernet jack, disconnected Wi-Fi, or dormant virtual bridge), the service waits until its 120-second timeout expires. Follow these steps to eliminate the boot delay.
Mark Unused Interfaces as Optional in Netplan Configuration
The cleanest and most robust method to resolve this issue is instructing Ubuntu’s Netplan network renderer that secondary or unlinked interfaces do not need to block system startup.
- Open your Netplan configuration file in a root terminal editor:
sudo nano /etc/netplan/00-installer-config.yaml(Note: Your filename may be
01-netcfg.yamlor50-cloud-init.yaml). - Locate your interface definitions under the
ethernets:orwifis:section. - Add the parameter
optional: truebeneath any secondary or unplugged network interface:network: version: 2 renderer: networkd ethernets: enp3s0: dhcp4: true enp4s0: dhcp4: true optional: true - Save the file by pressing Ctrl + O, press Enter, and exit nano with Ctrl + X.
- Apply the updated configuration:
sudo netplan apply
Configure the Wait-Online Service to Monitor Only the Primary Interface
Rather than waiting for every physical interface on the motherboard to obtain an IP address, configure systemd-networkd to proceed as soon as your primary connected interface is online.
- Create a systemd service override directory:
sudo systemctl edit systemd-networkd-wait-online.service - In the editor window, enter the following override lines (replace
enp3s0with your primary active network interface name):[Service] ExecStart= ExecStart=/lib/systemd/systemd-networkd-wait-online -i enp3s0 --timeout=15 - Save and exit the editor.
- This restricts monitoring to only your active cable connection and lowers the maximum fallback timeout from 120 seconds to 15 seconds.
Disable the Wait-Online Service on Standalone Desktops
On standalone desktop installations or developer machines that do not mount remote network file systems (such as NFS or iSCSI) at boot, the wait-online service is completely superfluous.
- Disable the service unit from starting during the boot sequence:
sudo systemctl disable systemd-networkd-wait-online.service - Mask the service to prevent other dependent units from triggering it:
sudo systemctl mask systemd-networkd-wait-online.service - Network interfaces will still configure normally via DHCP in the background after you reach the desktop login screen.
Verify Interface Status Using networkctl
To inspect the real-time operational status of your network ports and confirm which interfaces are causing delays:
- Run the network status utility:
networkctl status - Examine the Operational State column.
- Interfaces labelled
routableare healthy, while interfaces displayingconfiguring,no-carrier, orcarrierindicate disconnected ports that require theoptional: trueflag in Netplan.
Test System Boot Time with systemd-analyze
After applying your changes, reboot your system to verify the elimination of boot delays.
- Reboot the system:
sudo reboot. - Upon logging back in, analyze your startup performance:
systemd-analyze blame | head -n 10 - Confirm that
systemd-networkd-wait-online.serviceno longer appears at the top of the startup timeline, ensuring swift boot times.