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