nftables is the successor to iptables within the Linux Netfilter framework, merged into the mainline kernel in 3.13 (2014) and now the default firewall backend on all major distributions — Debian 10+, Ubuntu 20.04+, RHEL 8+, Fedora 32+. It replaces not just iptables but the entire family of legacy Netfilter frontends: ip6tables (IPv6), arptables (ARP), and ebtables (Ethernet bridging) are all unified under a single nft command and a single kernel subsystem. The kernel component is a generic, protocol-independent packet classification engine; the protocol-specific logic (IPv4, IPv6, ARP, bridging) is expressed in user-space rule syntax rather than hardcoded in separate kernel modules. This unification eliminates the fragmented ruleset management of the iptables era, where a firewall with consistent IPv4/IPv6 and bridging policy required coordinating four separate tools with four separate rulesets and four separate persistence mechanisms.
The nftables data model is more expressive than iptables. Rules are organised into tables (named, associated with a protocol family: ip, ip6, inet for dual-stack, arp, bridge, netdev) and chains (which declare their hook point and priority explicitly rather than being fixed as in iptables). The inet family is the key addition: a single inet table with inet chains handles both IPv4 and IPv6 traffic with one ruleset, eliminating the duplication of maintaining filter rules in both iptables and ip6tables. Rule syntax uses a consistent expression language: ip saddr 192.168.0.0/24, tcp dport { 80, 443 }, ct state established,related, meta oifname "eth0". The major performance and expressiveness improvement over iptables is sets and maps: nftables maintains kernel-side data structures (hash tables, radix trees, intervals) that can hold thousands of IP addresses or port ranges and match against them in O(1) or O(log n) time, rather than iptables’s O(n) linear scan. A set is declared once and referenced by name in rules: ip saddr @blocked_hosts drop — updating the set (adding or removing an IP) does not require reloading or re-evaluating the ruleset. Maps extend this to verdict maps (ip daddr map { 10.0.0.1: accept, 10.0.0.2: drop }) and NAT translation maps, enabling compact, data-driven rulesets that would require thousands of individual iptables rules. Ruleset updates are atomic: the entire ruleset can be replaced in a single nft -f operation using a transaction, preventing the brief inconsistency windows that iptables rule loading creates when rules are added one at a time.
In Kubernetes environments, nftables is relevant in two contexts. kube-proxy added an nftables backend (beta in Kubernetes 1.31) that replaces the historically iptables-based Service load balancing with nftables sets and maps, dramatically reducing rule count and improving connection setup latency at scale — the same 10,000-Service cluster that generates hundreds of thousands of iptables rules generates a handful of nftables sets instead. firewalld uses nftables as its backend on RHEL 8+ and Fedora, translating its zone-based policy model into nftables rules. The iptables-nft compatibility shim allows legacy tooling that emits iptables commands to function on nftables systems, but the shim carries overhead and loses nftables’ atomicity guarantees — production systems should migrate to native nftables rules or use firewalld rather than relying on the compatibility layer. eBPF-based CNI plugins like Cilium bypass Netfilter entirely for pod-to-pod traffic, attaching XDP and TC programs before packets reach the nftables hooks, so nftables and Cilium coexist at different layers of the networking stack: nftables handles host-level firewall policy, Cilium handles pod network policy in eBPF.
