iptables example rulesets and utility programs

Example rulesets have been moved to their own page to reduce the length of this page.

History of netfilter features sorted by kernel version - very incomplete, I would welcome any additions.

Programs

Ruleset manipulation

Ruleset debugging

Log analysis

Active response

Administration tools

Frontends

If you don't want to learn iptables, you can use one of several frontends to it. I haven't personally used any of them, but other people like them. There are many more on google; there are just the ones I have looked at.

Information

Tutorials

Papers

Diagrams

Rulesets

These rulesets are in iptables-save format. I have written some simple documentation of the iptables-save format. I use this format for several reasons: it ensures there are no other rules in iptables, it loads faster, it avoids the possibility of a race condition that most iptables scripts have (although the race window would be about 1ms for most rulesets).

There are several ways to use these rulesets.

For the best security, a firewall should be applied before the internet-facing interface is brought up. If you have a dynamic IP and need to use it in your ruleset, consider loading a simple deny-all firewall (remember to allow DHCP) before bringing up the interface, then switching to the real firewall after the you get an IP.

Related scripts

References

The iptables 1.3.6 manpage, which has a full syntax description and covers all the modules.

Netfilter, the official iptables/netfilter website.

Ask in the freenode IRC channel #iptables for more information, or for any other reason. I'm usually in there as danieldg. If you have any other examples, send them to me and I'll put them up on this page.

Last modified Fri Mar 7 15:56:48 2008. ©2005-2007 Daniel De Graaf