fix: reload nftables on tailscaled restart via PartOf= directive #216
No reviewers
Labels
No labels
domain:backend
domain:devops
domain:frontend
status:approved
status:in-progress
status:needs-fix
status:qa
type:bug
type:devops
type:feature
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
forgejo_admin/pal-e-platform!216
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "181-nftables-reload-after-tailscale"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Summary
iif "tailscale0"to a numeric ifindex at load time; when tailscaled restarts mid-uptime the interface gets a new index but nftables keeps the stale one, silently dropping all Tailscale trafficPartOf=tailscaled.serviceto the existing systemd drop-in so nftables automatically restarts whenever tailscaled restarts, re-resolving the interface nameChanges
salt/states/firewall/init.sls: AddedPartOf=tailscaled.serviceto the nftables systemd drop-in. Updated comments to document both failure modes (boot ordering and mid-uptime restart) and how each directive addresses them.Test Plan
sudo salt-call state.apply firewallcat /etc/systemd/system/nftables.service.d/after-tailscale.confshows all three directivessystemctl show nftables | grep PartOfshowsPartOf=tailscaled.servicesudo systemctl restart tailscaledthensudo nft list ruleset | grep iifshowsiif "tailscale0"(not a stale numeric index)nft list ruleset | grep iifresultReview Checklist
Related Notes
80-feat-fix-nftables-boot-ordering-start-afQA Review
Files reviewed:
salt/states/firewall/init.sls(1 file, +13/-4)Correctness
PartOf=tailscaled.serviceis the correct systemd directive for this problem. It causes nftables to restart when tailscaled restarts. Combined with the existingAfter=tailscaled.service, the restart ordering is correct: tailscaled finishes starting first (interface exists with new ifindex), then nftables restarts (re-resolvesiif "tailscale0"to current ifindex).daemon-reload,service.enabled,cmd.wait) remain intact.Edge case noted (informational, not blocking)
PartOf=means nftables also stops when tailscaled stops (systemctl stop tailscaled). This leaves the host with no firewall. Acceptable because: (a) stopping tailscaled is a deliberate operator action, (b) the nftables rules referencingtailscale0are meaningless without the interface, and (c) the nextsystemctl start tailscaledwill bring nftables back viaWants=.SOP compliance
Closes #181present for auto-closeNits
None.
VERDICT: APPROVE
PR #216 Review
DOMAIN REVIEW
Tech stack: Salt (SaltStack state files) + systemd drop-in configuration.
Salt compliance:
file.managedwithcontentsblock for the drop-in.cmd.waitonnftables-daemon-reloadalready watchesnftables-after-tailscale, so adding a new line to the drop-in contents will triggersystemctl daemon-reloadautomatically. Requisite chain is correct.systemd semantics:
PartOf=tailscaled.serviceis the correct directive. It creates a restart/stop coupling: when tailscaled is restarted or stopped, nftables will also be restarted or stopped. This is exactly the desired behavior for re-resolving the ifindex.After=(ordering),Wants=(soft dependency pull-in),PartOf=(lifecycle coupling). No conflicts or redundancy.iif "tailscale0"is rendered bynftables.conf.j2viaallowed_interfacesinsalt/pillar/firewall.sls, confirming the ifindex caching risk described in the PR.Comment quality:
BLOCKERS
None.
The "test coverage" BLOCKER criterion does not apply here. This is a 1-line systemd directive addition to a Salt state. There is no test infrastructure for Salt states in this repo (validation is manual highstate + systemctl verification, as documented in the Test Plan). The PR's Test Plan provides 5 concrete manual verification steps covering the exact behavior change.
NITS
main): The file header referencesPhase 3 of plan-2026-02-26-salt-host-management. Plans are a deprecated concept per project conventions. Not introduced by this PR, so not blocking, but noted for future cleanup.SOP COMPLIANCE
181-nftables-reload-after-tailscalereferences issue #181Closes #181, cross-references #174 (discovery context) and prior boot-ordering branchfix: reload nftables on tailscaled restart via PartOf= directiveMinor SOP note: The PR body uses
## Related Notesinstead of## Related, and## Review Checklistis not part of the standard template. Neither is blocking -- the substance is all there.PROCESS OBSERVATIONS
PartOf=directive is additive to existing behavior. If tailscaled does not restart, this directive has zero effect. The existing boot-ordering behavior is unchanged.sudo salt-call state.apply firewallon the target host. Not CI-deployed. Test plan is thorough.VERDICT: APPROVED