Skip to content
BENIBIX Learn

nftables

Infrastructure⌨️ Linux & the Command LineFirewall Tools

Also known as nft, nft Command, nftables Firewall

The new way Linux keeps its firewall rules. It took the place of the old one.

Think of it like

Think of it like the new rule book for the gate guard. It replaced the old book.

Example

Emma's Debian server shows its firewall rules with nft. A table called filter holds them.

Why it matters

It is the layer that holds the rules on a new Linux system.

Definition

nftables is the part of Linux that holds firewall rules today. It replaced the older iptables. The kernel checks each packet against its rules. You can write rules with the nft command, or let a simple tool like UFW write them. On Debian, it has been the default since Debian 10.

Example code

console
$ sudo nft list tables
table inet filter
One table of rules, named filter, for both old and new style addresses.
nftables is the layer that holds the rules on a new Linux system.

Common mistake

Mixing nft rules and iptables rules by hand on one server. The two sets can clash in ways that are hard to see.

Key takeaways

  1. 1
    The new system. It replaced iptables.
  2. 2
    In the kernel. Every packet is checked.
  3. 3
    nft command. Or a simpler tool on top.

Compare

Learn it properly