NetBird routes and/or policies disappear (are removed by systemd-networkd) #2334

Open
opened 2025-11-20 07:07:57 -05:00 by saavagebueno · 0 comments
Owner

Originally created by @nazarewk on GitHub (Oct 2, 2025).

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=true since v246 - possibly affects NetBird
  • 💣 ManageForeignRoutingPolicyRules=true since v249 - confirmed to affect NetBird
  • ManageForeignNextHops=true since v256 - 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=false

To 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 rule

on 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 7120

on 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

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
Originally created by @nazarewk on GitHub (Oct 2, 2025). **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=true` since `v246` - possibly affects NetBird - 💣 `ManageForeignRoutingPolicyRules=true` since `v249` - confirmed to affect NetBird - ❔ `ManageForeignNextHops=true` since `v256` - 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: ```text [Network] ManageForeignRoutes=false ManageForeignRoutingPolicyRules=false ManageForeignNextHops=false ``` **To Reproduce** To check whether you are affected see if `systemd-networkd` is running: ```text > 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: ```shell ip rule netbird up ip rule systemctl restart systemd-networkd ip rule ``` on the 2nd run of `ip rule` you will notice 2 new rules: ```text 105: from all lookup main suppress_prefixlength 0 110: not from all fwmark 0x1bd00 lookup 7120 ``` on 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?** - [x] Reviewed [client troubleshooting](https://docs.netbird.io/how-to/troubleshooting-client) (if applicable) - [x] Checked for newer NetBird versions - [x] Searched for similar issues on GitHub (including closed ones) - [x] Restarted the NetBird client - [x] Disabled other VPN software - [x] Checked firewall settings
saavagebueno added the bugclientnetworking labels 2025-11-20 07:07:57 -05:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: SVI/netbird#2334