netfilter is a very important part of the Linux kernel in terms of security, packet mangling, and manipulation. The front end for netfilter is iptables, which "tells" the kernel what the user wants to do with the IP packets arriving into, passing through, or leaving the Linux box.
The most used features of netfilter are packet filtering and network address translation, but there are a lot of other things that we can do with netfilter, such as packet mangling Layer 7 filtering.
A rough explanation on how netfilter works is like this:
The user instructs the kernel about what it needs to do with the IP packets that flow through the Linux box using the iptables tool.
The Linux box then analyzes the IP headers on all packets flowing through it.
If, when looking at the IP headers, the kernel finds matching rules, then the packet is manipulated according to the matching rule.
It might look very simple at the beginning, but actually is a lot more complicated process. netfilter has...