nftables.service(8)

πŸ“¦ version 1.1.6, in alpine 3.23, alpine 3.24, opensuse-leap 16.0

πŸ’– Name πŸ’–

Okay bestie, this is nftables.service(8) β€” a page straight from the nftables admin reference, and it’s all about the static firewall configuration service. πŸ‘‘

✨ Description ✨

There’s an nftables systemd service, and its whole vibe is letting you set up static firewall rulesets based on a configuration file. Config file in, firewall ruleset served. πŸ’…

To use this service, you need to create the main configuration file at /etc/nftables/rules/main.nft. A template you can copy is at /usr/share/doc/nftables/main.nft β€” free starter pack, no cap. πŸŽ€

Alternatively, nft list ruleset >main.nft can be used to save the active configuration (if any) into the file. Lowkey the easiest glow-up from β€œcurrently running” to β€œsaved static config.” ✨

Once your desired static firewall configuration is in place, test it by running:

systemctl start nftables.service

To enable the service at boot time, run:

systemctl enable nftables.service

That’s the whole main-character move: start it to test, enable it so it shows up at boot. 🫢

πŸ¦‹ See also πŸ¦‹

  • nft(8) β€” the other icon, go read it. πŸ’œ

Cute sign-off: source/version nftables, page nftables.service(8), and the date field is a no-show in this footer β€” no fake dates here, bestie. 🌈