View Single Post
Old 7th November 2007, 23:03
technick technick is offline
Junior Member
Join Date: May 2006
Posts: 19
Thanks: 0
Thanked 0 Times in 0 Posts

First off, the rules you have posted are a mess. In one line you close a port and further down you reopen the port. IPTables is incredibly powerful and simple at the same time once you are in the correct frame of mind.

The best thing I see in your existing rules is your default policy value to drop all traffic by default.

Follow me for a second with my line of thinking. Since your default policy is to drop all traffic (INPUT,OUTPUT,FORWARD), why do you specify again to drop certain ports? Here is an example of what I am talking about.

# Block Port number
$IPTABLES -A INPUT -i eth1 -p tcp --dport 22 -j REJECT

(Ok, here we are blocking port 22 on eth1 specifically)

# Open ports for Server
$IPTABLES -A INPUT -s 0/0 -p tcp --dport 22 -j ACCEPT # SSH

(This is telling iptables that its ok to talk to any network on port 22)

Personally I would of done this.

iptables –A INPUT -i eth0 -j ACCEPT

You should really look into the program “Firewall Builder”

Found here.
Reply With Quote