Stateful nftables rules: conntrack, default drop, tracing

11 steps · about 3 h 40 min · Intermediate

  1. Stateful firewall (article, Wikipedia, 10 min)

    Start with the idea of tracking sessions rather than judging each packet alone, since everything later builds on it.

  2. Netfilter (article, Wikipedia, 15 min)

    Shows where hooks, connection tracking and nftables sit in the Linux kernel before you write any rules.

  3. Quick reference-nftables in 10 minutes (reference, nftables wiki (Netfilter project), 15 min)

    The official vocabulary of tables, chains, hooks and rules, which you need to read any ruleset.

  4. nftables wiki (doc, nftables wiki (Netfilter project), 15 min)

    The upstream index: use it to find the conntrack page, example rulesets and troubleshooting notes.

  5. nftables - Debian Wiki (doc, Debian Wiki, 10 min)

    Practical setup: install the package, enable the service and find /etc/nftables.conf so you can run a first ruleset.

  6. How to Create a Stateful Firewall with nftables Connection Tracking (tutorial, OneUptime, 20 min)

    A compact, complete default-drop ruleset with established,related accept, invalid drop and specific new-connection allows.

  7. How to Configure nftables for Stateful Packet Filtering on Ubuntu (tutorial, OneUptime, 25 min)

    Adds named sets, logging and a server example, so you can make the first ruleset easier to maintain.

  8. Linux nftables Deep Dive: Modern Stateful Firewalls (article, Berik Ashimov, 25 min)

    Goes deeper on conntrack matching, hook priorities and notrack, and introduces nft monitor trace.

  9. Designing Stateful Linux Firewalls with native nftables Rulesets and NAT (guide, KloudVin, 35 min)

    Extends to forwarding, NAT, verdict maps, rate limits and atomic reloads, and shows tracing a single client's packets.

  10. nftables: The Modern Linux Firewall Replacing iptables — Complete Guide (2026) (guide, The Linux Club, 30 min)

    Pulls it together with variables, sets and SSH brute-force limiting, plus syntax checking with nft -c before you apply.

  11. nftables - ArchWiki (reference, ArchWiki, 20 min)

    A final reference for persistence and everyday usage once you are writing your own rules.