Nftables/Examples

On this page several example nftable configurations can be found.

Basic firewall
The following is an example of nftables rules for a basic IPv4 firewall that: 1) allows only packets from lan to the firewall machine and 2) only allows packets from wan to lan for connections established by lan.

Typical workstation example
The following is an example of nftables rules for a typical workstation that recreates chains and tables known from iptables.

Simple stateful router example
The following is an example of nftables configuration script for a simple stateful router.