Tokyo Edge Notes

Writing Idempotent Dual-Stack Firewalls with nftables

Published 2026-11-24 · 4 min read

Using the inet address family in nftables lets one ruleset govern both IPv4 and IPv6 traffic. A frequent operational mistake is placing a global flush ruleset at the top of /etc/nftables.conf, which unintentionally wipes dynamic tables managed by daemons such as Fail2Ban.

Table-Scoped Reloading

table inet vps_filter
flush table inet vps_filter

Scoping the flush strictly to your own filter table preserves auxiliary enforcement tables while remaining completely idempotent across nft -f reloads.