Blog Archives

How to set up a stateful firewall with iptables

My old post to set up a small rules set for iptables is deprecated so I decided to update this post and improve some rules.
This time I tested this iptables setup on my Raspberry Pi. I connected to my Pi via SSH and the first time I tested the rules order I locked myself out and I had to connect the monitor and keyboard to fix this. The rule order in this post worked for me to set everything up via SSH.

I also tried this setup on a virtual machine and made a screencast of it. You can find the video at the end of this post.

1. Kernel modules
2. Important Rules
3. Chain Policies
4. Port Rules
5. Logging
6. Saving Rules
7. Appendix (Script and video)
Read the rest of this entry

How to set up a small rule set for iptables

In this how-to I will give you an introduction to iptables and show you how to set up a small rule set for iptables. If you want more detailed information I recommend the man page of iptables (its great).

This post is deprecated

I wrote an updated version: click here

1. Basic informations
2. Chain policies
3. Setting port rules
4. Saving rules
Read the rest of this entry