Fresh Ubuntu Server 26.04 install on the Folio. Nothing exotic … wired NIC (enp0s25) sitting there with no cable in it, wifi doing all the actual work like it always does on a laptop. Should be a non-issue.
Boot time said otherwise. Over 2 minutes. On a server. For nothing.
$ systemd-analyze blame
2min 151ms systemd-networkd-wait-online.service
Yep. There it is. Confirmed with the critical chain too … network-online.target wasn’t hit until 2min 5.041s in. Two minutes just sitting there.
why
$ networkctl status enp0s25
● 2: enp0s25
State: no-carrier (configuring)
Online state: offline
...
Required For Online: yes
No cable. No carrier. Never going to come up. But it’s flagged as required, so wait-online sits there patiently waiting on an interface that is never, ever going to answer … full 120 second timeout, every single boot, forever, until I fixed it.
the “fix” that does nothing
Netplan’s got a key for exactly this. optional: true. Read the docs, seems dead simple:
network:
ethernets:
enp0s25:
match:
macaddress: d8:9d:67:33:98:d4
set-name: enp0s25
optional: true
version: 2
wifis:
wlo1:
dhcp4: true
netplan get confirms it took:
match:
macaddress: "d8:9d:67:33:98:d4"
optional: true
set-name: "enp0s25"
Great, right? Should spit out RequiredForOnline=no into the generated config and I’m done.
Nope.
netplan apply
Nothing. Deleted the generated file, forced a clean netplan generate. Still nothing:
[Match]
PermanentMACAddress=d8:9d:67:33:98:d4
Name=enp0s25
[Network]
LinkLocalAddressing=ipv6
No [Link] block. No RequiredForOnline=no. Netplan happily takes the key, stores it, says nothing’s wrong, and then just… doesn’t do anything with it. On netplan.io 1.2-1ubuntu5. No error. No warning. Nothing. Wasted a good chunk of time convinced I’d fat-fingered the YAML before I actually double and triple checked it was fine.
what actually worked
Stopped trusting netplan to translate it and went straight to systemd instead. Override wait-online directly, tell it to ignore that interface, done:
sudo mkdir -p /etc/systemd/system/systemd-networkd-wait-online.service.d
sudo tee /etc/systemd/system/systemd-networkd-wait-online.service.d/override.conf > /dev/null << 'EOF'
[Service]
ExecStart=
ExecStart=/lib/systemd/systemd-networkd-wait-online --ignore=enp0s25
EOF
sudo systemctl daemon-reload
Don’t skip that blank ExecStart= line … systemd overrides append by default, so if you don’t clear the original first you’ll have two ExecStart lines fighting each other.
Rebooted.
Startup finished in 8.159s (firmware) + 6.460s (loader) + 2.353s (kernel) + 3.296s (initrd) + 5.647s (userspace) = 25.917s
Oh boy. At last. It actually worked. network-online.target at 5.112s. From over two minutes down to 25.9 seconds total.
why this is the better fix anyway
Even ignoring that netplan’s broken here … this is the more solid way to do it regardless:
- doesn’t care whether netplan’s YAML-to-systemd translation is working on whatever version you’ve got
- it’s explicit … “ignore this interface,” full stop, no depending on a generated file being right
- survives netplan regenerating configs, package updates, whatever … it’s systemd’s own override, netplan can’t touch it or break it later
What i got from this
If wait-online is eating your boot time and you’ve got a NIC that’s never coming up … no cable, disabled dock, whatever … don’t just trust that optional: true did what it says on the tin. Check it yourself:
cat /run/systemd/network/10-netplan-<interface>.network
No RequiredForOnline=no under [Link]? Stop fighting netplan. Override wait-online with --ignore=<interface> instead. One file, works every time, can’t quietly break on you later.