Skip to content

Instantly share code, notes, and snippets.

@kfiresmith
Last active October 27, 2023 15:14
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save kfiresmith/dbf6464ffa9c9385936c8d0fd9ef7e41 to your computer and use it in GitHub Desktop.
Save kfiresmith/dbf6464ffa9c9385936c8d0fd9ef7e41 to your computer and use it in GitHub Desktop.
Cause and resolution to failure of systemd-network-wait-online.service failure on boot.

Long startup times due to systemd-network-wait-online.service

Problem

TL;DR: Essentially because of some quirk with networkd, all interfaces get stuck in a '(configuring)' state forever unless you set an empty link-local address for at least the primary interface (but I set it for both).

Systemd-network-wait-online.service waits for at least one interface to be fully online, and won't consider an interface to be fully online if it's in '(configuring)' status when you run networkctl status some-iface.

Solution

Set link-local: [] to be set on every interface:

for interface in $(netplan status | grep networkd | awk '{print $3}'); \
  do netplan set ethernets.$interface.link-local=[]; done

Example outcome:

network:
  ethernets:
    ens160:
      link-local: []
      addresses:
      - 10.10.0.8/24
      nameservers:
        addresses:
        - 10.10.0.2
        - 10.10.0.3
        search:
        - college.edu
      routes:
      - to: default
        via: 10.10.0.1
    ens192:
      link-local: []
      addresses:
      - 10.11.0.10/24
  version: 2

Resources:

systemd/systemd#8686 (comment)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment