NetBird routes and/or policies disappear (are removed by `systemd-networkd`)
Describe the problem
This issue was discovered internally, but we are reporting it for visibility and the benefit of the community.
In short, systemd-networkd is gradually introducing the deletion of "foreign" (external to networkd) configurations upon startup. This is known to disrupt some networking (especially VPN) software, including NetBird.
We don't know the exact scenarios resulting in systemd-networkd.service restarting, but one possibility might be recovering from sleep/suspend.
The default configuration is as follows:
- ❓
ManageForeignRoutes=truesincev246- possibly affects NetBird ManageForeignRoutingPolicyRules=truesincev249- confirmed to affect NetBird- ❔
ManageForeignNextHops=truesincev256- I don't think we use this one as of writing the report
We are still considering a number of different countermeasures to take, but you can disable this behaviour yourself by creating a file at /etc/systemd/networkd.conf.d/10-dont-break-vpn.conf (the name doesn't really matter as long as it ends with .conf) with the following content:
[Network]
ManageForeignRoutes=false
ManageForeignRoutingPolicyRules=false
ManageForeignNextHops=falseTo Reproduce
To check whether you are affected see if systemd-networkd is running:
> systemctl status systemd-networkd.service
● systemd-networkd.service - Network Configuration
Loaded: loaded (/etc/systemd/system/systemd-networkd.service; enabled; preset: ignored)
...
Active: active (running) since Thu 2025-10-02 11:16:22 CEST; 6h ago
...Then try to reproduce the issue:
ip rule
netbird up
ip rule
systemctl restart systemd-networkd
ip ruleon the 2nd run of ip rule you will notice 2 new rules:
105: from all lookup main suppress_prefixlength 0
110: not from all fwmark 0x1bd00 lookup 7120on the 3rd run of ip rule you will notice the above rules being deleted
Expected behavior
The rules are either preserved and/or recreated reasonably soon (a few seconds) after removal.
Are you using NetBird Cloud?
n/a
NetBird version
n/a
Is any other VPN software installed?
n/a
Debug output
n/a
Screenshots
n/a
Additional context
- https://github.com/systemd/systemd/issues/19106
- https://web.archive.org/web/20250906155911/https://www.freedesktop.org/software/systemd/man/latest/networkd.conf.html#ManageForeignRoutingPolicyRules=
- https://web.archive.org/web/20251001120906/https://wiki.archlinux.org/title/Systemd-networkd#Usage
- https://web.archive.org/web/20250930224010/https://wiki.archlinux.org/title/WireGuard#Connection_lost_after_sleep_using_systemd-networkd
Have you tried these troubleshooting steps?
- Reviewed client troubleshooting (if applicable)
- Checked for newer NetBird versions
- Searched for similar issues on GitHub (including closed ones)
- Restarted the NetBird client
- Disabled other VPN software
- Checked firewall settings
Source: netbirdio/netbird