Unix & Linux Stack Exchange is a question and answer site for users of Linux, FreeBSD and other Un*x-like operating systems. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I am using Linux at home and want to be able to configure firewall. I would like to understand what I am doing not just copy paste some rules from internet :).

share|improve this question

closed as too broad by Ramesh, jasonwryan, devnull, Patrick, Thomas Nyman May 14 '14 at 5:00

There are either too many possible answers, or good answers would be too long for this format. Please add details to narrow the answer set or to isolate an issue that can be answered in a few paragraphs.If this question can be reworded to fit the rules in the help center, please edit the question.

up vote 3 down vote accepted

If you want to really understand what you are doing, you've got your work cut out for you as iptables is massively complex: frozentux iptables tutorial. This is a highly recommended tutorial (it's free).

If you're willing to break a few bucks: http://www.amazon.com/Linux-Firewalls-3rd-Steve-Suehring/dp/0672327716

share|improve this answer
I never liked the frozentux tutorial... I couldn't get heads or tails out of it, drobbins article on stateful firewalls is still the best guide to groking iptables IMO. I can't speak about the book though. – xenoterracide Aug 22 '10 at 16:04

Dan Robbins (the creator of Gentoo) wrote a great article on Stateful Firewall Design. It's by far the easiest to understand iptables tutorial.

It says '2.4' however all but the kernel config will apply equally as well to '2.6'. Even though the article is hosted by gentoo (I could have linked to IBM developerworks too) it's distribution independent (except for emerge iptables which should be read as use your package manager to get the iptables command).

share|improve this answer

I'm a huge fan of the Wiki over at Rackspace Cloud Servers. Their page on IPTables is not as detailed as some of the other stuff out there, but it gets you off the ground without causing too much confusion.

share|improve this answer

I just stumbled on to this question and I thought I'd add a reference to an IPtables tutorial that I've written. It's more server-oriented, but it might be useful to anyone configuring IPtables for a home computer as well. It does include a lot of information on why each rule is set up the way it is.


share|improve this answer

Here's an article I wrote about setting up iptables for a destkop. IPTables for the average desktop user, and another one if you need to connect to a windows (smb) file share network, called IPTables browsing Samba shares.

share|improve this answer

Your distribution probably has some graphical thingy that allows to check services you want to offer, and outbound traffic you allow. For most uses this should be enough (or at least give a buffer zone until you learn to frob it by hand).

share|improve this answer

Not the answer you're looking for? Browse other questions tagged or ask your own question.