The doorman’s book that rewrites addresses at the edge of a building. This lesson shows the same book kept inside the Linux kernel, and the wall that reads it.
On 4 January 2001 Linus Torvalds released Linux 2.4.0. It carried a new packet-filtering framework called netfilter, and its authors wrote down what changed. Under the old tool, ipchains, a forwarded packet “used to traverse three chains”, and the paper calls fixing that “one big change”. The new tool, iptables, was described as small and fast. Harald Welte’s paper on it adds that connection tracking lets the filter use “‘stateful firewalling’”.
That is the whole idea. Before it, a Linux wall judged every packet alone, like a guard who has never seen the visitor before. Afterwards the wall kept a list of the conversations it had let start, and judged each packet against the list.
By the end of this lesson you will be able to read a small nftables ruleset, say what each line does to a packet, and explain why a home router can let your reply in while it refuses a stranger.
Before you start.Inside your building (your router's life) gave you the doorman’s book, which rewrites a flat’s private address and port into the building’s public ones, and the four-part identity of a connection (source address, source port, destination address, destination port). Security Groups vs Network ACLs showed that a wall which judges each packet alone must leave a huge range of doors open for replies, while a wall with memory does not. It won't load: the ladder (network debugging) showed that a firewall can reject a knock or silently drop it, and that you can tell the two apart by the wait.
Lesson 38 of 44 in Networking
The rest of this lesson is part of a plan.
A plan opens every lesson, board, video, lab and paper on chalk. Yearly is $39/year.