Networking

systemd-networkd drops IPv6 default route after netplan apply/resume on Ubuntu 22.04 — RA visible but no ::/0 route

Environment

Environment

Laptop running Ubuntu 22.04 LTS with netplan renderer=networkd, wired interface enp3s0 and IPv6 autoconfiguration via SLAAC/RA from an on-prem router; resume from suspend or netplan apply after docking reproduces the problem.

Symptoms

Symptoms

After resume or running 'sudo netplan apply' IPv6 connectivity to the internet is lost: websites time out over IPv6, traceroute6 shows no default hop, but interface still has a global IPv6 address and local neighbor entries.

Observations

Observations

ip -6 addr shows valid global address; ip -6 route lacks a default (::/0) entry; sudo tcpdump -i enp3s0 icmp6 shows Router Advertisements arriving; sysctl net.ipv6.conf.all.accept_ra reported 0 on affected interfaces after resume.

Already attempted

Already attempted

Restarted systemd-networkd and NetworkManager, replugged cable, rebooted, ran 'sudo netplan apply' several times, and temporarily added a manual 'ip -6 route add default via <router-ip> dev enp3s0' which restored connectivity until next suspend.

Question

Question

What causes the kernel or systemd-networkd to stop installing the RA-provided default route after resume or netplan apply, and what is the safe fix so the default route is restored automatically without manual route add or reboot?

COMMUNITY RESPONSES

Verified community troubleshooting

1 reply
0
nathalie_net Answer
user
Posted 4w ago • 0 confirmations

Quick check: confirm RAs are arriving but no default is installed (sudo tcpdump -n -i enp3s0 icmp6 and ip -6 route). If RAs arrive, the kernel may be refusing them—verify sysctl net.ipv6.conf.enp3s0.accept_ra and net.ipv6.conf.all.accept_ra. Temporarily enable with sudo sysctl -w net.ipv6.conf.all.accept_ra=1 and sudo sysctl -w net.ipv6.conf.enp3s0.accept_ra=1, then solicit routers with rdisc6 enp3s0 or restart systemd-networkd. If that restores ::/0, persist by adding /etc/sysctl.d/99-ipv6-accept-ra.conf and ensure only one manager (networkd vs NetworkManager) controls the interface. Roll back by removing the sysctl file and reboot.

Showing 1 of 1 community responses
AI DIAGNOSTICS

Incident analysis

Updated 4w ago• Trouble ID

Most likely causes

Kernel per-interface accept_ra gets set to 0 after resume or by another manager, preventing automatic installation of RA routes. 85%
Conflicting controllers (NetworkManager vs systemd-networkd) or netplan renderer mismatch causes race or partial/unmanaged state at resume. 65%
Netplan/systemd-networkd is configured to ignore RA-provided routes (e.g., use of DHCPv6 overrides or 'use-routes' disabled), so RAs are received but not installed. 55%

Summary

When RAs are received but the kernel/systemd-networkd does not install the default route, common causes are the kernel's per-interface accept_ra sysctl being 0 (sometimes toggled by network manager or after resume), a race or conflict between network managers (networkd vs NetworkManager) leaving interfaces unmanaged or with incorrect settings, or netplan/systemd-networkd configured to ignore RA-supplied routes. Router firmware bugs or filtering of ICMPv6 by host firewall are less common but possible. The immediate safe remediation is to re-enable accept_ra and restart the network daemon; persistent fixes include adjusting sysctl settings to persist across resume or configuring systemd-networkd to accept RAs explicitly or to manage the interface exclusively.

Suggested Fixes

Diagnostic step 1
Check current routes and RA presence: sudo ip -6 route && sudo tcpdump -n -i enp3s0 icmp6 -c 5 (install 'tcpdump' if missing) to confirm RAs arrive but default route missing.
Diagnostic step 2
Inspect accept_ra values: sysctl net.ipv6.conf.all.accept_ra && sysctl net.ipv6.conf.default.accept_ra && sysctl net.ipv6.conf.enp3s0.accept_ra. If any report 0, temporarily enable: sudo sysctl -w net.ipv6.conf.all.accept_ra=1 && sudo sysctl -w net.ipv6.conf.enp3s0.accept_ra=1.
Diagnostic step 3
Solicit RAs and restart network stack: install ndisc6 (sudo apt install ndisc6) then run sudo rdisc6 enp3s0 to force router solicitation; if that doesn't help, restart: sudo systemctl restart systemd-networkd && sudo journalctl -u systemd-networkd -n 200 --no-pager to inspect errors.

Continue troubleshooting

Matched from the title, description and tags