Skip to content
BENIBIX Learn

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.

Infrastructure⌨️ Linux & the Command Line

iptables

The older Linux firewall tool. It still works, on top of nftables.

iptables is the older Linux tool for writing firewall rules. Each rule says what to do with a kind of packet, like accept or drop. Guides from many years still use it, so you will see it often. On current Debian and Ubuntu, the iptables command still works. Behind the scenes, it writes its rules into nftables.

Example
Jack follows an old guide that uses iptables. The command works on his new server, and the rule lands in nftables.
Why it matters
Most firewall guides online are written for it. Knowing it lets you read them.
Full entry
Infrastructure⌨️ Linux & the Command Line

nftables

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

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.
Why it matters
It is the layer that holds the rules on a new Linux system.
Full entry

In one line

iptables
The older Linux firewall tool. It still works, on top of nftables.
nftables
The new way Linux keeps its firewall rules. It took the place of the old one.