fix: preserve Tailscale policy rules across networkd restarts - #155
Merged
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What this fixes
During activation of #154, systemd-networkd restarted and removed Tailscale's policy-routing rules at priorities 5210–5270 twice. Tailscale logged the deletion/restoration alongside failed NextDNS-over-HTTPS queries.
Set
systemd.network.config.networkConfig.ManageForeignRoutingPolicyRules = falseon patroclus so networkd leaves other services' policy rules alone. The bridge design, host DNS settings, firewall, and IPv6 privacy settings remain unchanged.Regression test
Add
system.build.networkdRoutingPolicyTest, a real disposable NixOS VM test using the pinned networkd and the production host's global networkd settings.Verified:
yesdefault deletes the rules.Run from the repository root:
nix build --no-link --print-build-logs \ .#nixosConfigurations.patroclusStripped.config.system.build.networkdRoutingPolicyTestThe complete test passed, including its negative control. Host derivation evaluation also passed. No live host networking services were restarted or reconfigured to test this change.
Scope of evidence
This fixes the confirmed foreign-policy-rule deletion. The test does not emulate NextDNS HTTPS connections or establish that this was the sole cause of the full DNS interruption; simultaneous temporary IPv6 address changes may also have contributed. Documentation records this limitation.