# nftables

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

**Field:** Infrastructure  
**Category:** Linux & the Command Line  
**Also known as:** nft, nft Command, nftables Firewall

## Think of it like

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

## 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

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

## Example code

```console
$ sudo nft list tables
table inet filter
```

One table of rules, named filter, for both old and new style addresses.

## Why it matters

It 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.

## Three principles

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

## Related terms

- [iptables](https://learn.benibix.com/term/infrastructure/iptables)
- [Uncomplicated Firewall (UFW)](https://learn.benibix.com/term/infrastructure/ufw)
- [Firewall](https://learn.benibix.com/term/infrastructure/firewall)
- [Network Packet](https://learn.benibix.com/term/infrastructure/packet)

## Told apart from

- [iptables vs nftables](https://learn.benibix.com/compare/iptables-vs-nftables): People often think iptables is the firewall on a new Linux server. Today it is a front door to nftables. The iptables command still works on Debian and Ubuntu. But it writes its rules into nftables. Mixing rules from both by hand can make them clash.

## Taught in

- [UFW and Linux Firewalls](https://learn.benibix.com/learn/infrastructure-linux/ufw-and-linux-firewalls): Linux CLI, 10/10

![Four stacked layers. At the top, UFW takes a short rule, allow 22. Beside it, the older iptables command takes a long rule. Both feed down into nftables, which holds the rules. At the bottom, the Linux kernel checks every packet against them.](https://learn.benibix.com/diagrams/inf3-linux-firewall.svg)

---

Source: https://learn.benibix.com/term/infrastructure/nftables
Author: Behnia Zarei (a developer in Vienna, Austria, who builds and teaches data, AI and business intelligence at BENIBIX)
Publisher: BENIBIX Learn (https://learn.benibix.com/)
Last updated: 2026-11-17
Licence: CC BY 4.0 (https://creativecommons.org/licenses/by/4.0/). Quote freely with attribution.
