Skip to content

/compare/iptables/iptables-vs-nftables

iptables vs nftables: differences and migration

The commands on this page have not been executed by our verification runner yet.updated 2026-10-20
tool
iptables / nftables
compares
iptables vs nftables

nftables is the successor of iptables in the Linux kernel's netfilter framework. One command, nft, and one ruleset language cover IPv4, IPv6, ARP and bridge filtering, and a whole ruleset can be replaced atomically. Most current distributions use nftables underneath; their iptables command is often iptables-nft, which translates iptables syntax to nftables rules.

Criterion by criterion

Criterioniptablesnftables
Toolsiptables, ip6tables, arptables, ebtablesnft
Tables and chainspredefined (filter, nat, mangle…)you create them; no empty default chains
IPv4 and IPv6separate rule setsone inet table for both
Sets and mapsipset as a separate toolbuilt in
Updatesrule by ruleatomic: nft -f replaces the ruleset in one transaction
Several actions per ruleno (one target)yes (counter, log and accept in one rule)

The same rule in both

bash
# iptables: allow SSH
iptables -A INPUT -p tcp --dport 22 -j ACCEPT

# nftables: allow SSH for IPv4 and IPv6
nft add rule inet filter input tcp dport 22 accept

Migrate

  • iptables-translate -A INPUT -p tcp --dport 22 -j ACCEPT prints the equivalent nft command.
  • iptables-save > rules.v4 && iptables-restore-translate -f rules.v4 > ruleset.nft converts a saved ruleset.
  • Check which backend your iptables uses with iptables -V: (nf_tables) means iptables-nft, (legacy) the old backend.

Sources