This document covers everything setting up an iptables firewall to the theory behind the steps. The author also includes a handy rc.flush script to use when setting up and debugging the firewall. Getting firewalled from your own machine really sucks.

From the author:

I originally wrote this as a very small tutorial for boingworld.com, which was an Amiga/Linux/General newssite that a small group of people, including me, ran a couple of years back. Due to the fantastic amount of readers and comments that I got from it, I continued to write on it. The original version was approximately 10-15 A4 pages in printed version and has since been growing slowly but steadily. A huge amount of people has helped me out, spellchecking, bug corrections, etc. At the time of writing this, the http://iptables-tutorial.frozentux.net/ site has had over 600.000 unique hits alone.

This document was written to guide you through the setup process step by step and hopefully help you to understand some more about the iptables package. I have based most of the stuff here on the example rc.firewall file, since I found that example to be a good way to learn how to use iptables. I decided to just follow the basic chain structure and from there walk through each and one of the chains traversed and explain how the script works. That way the tutorial is a little bit harder to follow, though this way is more logical. Whenever you find something that’s hard to understand, just come back to this tutorial.

Table of Contents:

1. Introduction
2. TCP/IP repetition
3. IP filtering introduction
4. Network Address Translation Introduction
5. Preparations
6. Traversing of tables and chains
7. The state machine
8. Saving and restoring large rule-sets
9. How a rule is built
10. Iptables matches
11. Iptables targets and jumps
12. Debugging your scripts
13. rc.firewall file
14. Example scripts
15. Graphical User Interfaces for Iptables/netfilter

Popularity: 27%