Linode Forum
Linode Community Forums
 FAQFAQ    SearchSearch    MembersMembers      Register Register 
 LoginLogin [ Anonymous ] 
Post new topic  Reply to topic
Author Message
 Post subject: iptables firewall
PostPosted: Tue Mar 10, 2009 3:27 pm 
Offline
Newbie

Joined: Tue Mar 10, 2009 3:19 pm
Posts: 2
Hi. I'm new to linode and although I have been playing with GNU/Linux since circa 1992 I am by no means an expert.

I followed the iptables guide at http://www.linode.com/wiki/index.php/Ne ... to#Scripts and all went well. However, my iptables -nL looks like this, and I'm not sure if I'm good to go or not.

Code:
Chain INPUT (policy ACCEPT)
target     prot opt source               destination         
ACCEPT     all  --  anywhere             anywhere           
ACCEPT     udp  --  anywhere             anywhere            udp spt:domain dpts:1024:65535
ACCEPT     tcp  --  anywhere             anywhere            tcp spts:1024:65535 dpt:22 state NEW
ACCEPT     tcp  --  anywhere             anywhere            tcp spts:1024:65535 dpt:www state NEW
ACCEPT     tcp  --  anywhere             anywhere            state RELATED,ESTABLISHED
DROP       all  --  anywhere             anywhere           

Chain FORWARD (policy ACCEPT)
target     prot opt source               destination         
DROP       all  --  anywhere             anywhere           

Chain OUTPUT (policy ACCEPT)
target     prot opt source               destination         
ACCEPT     all  --  anywhere             anywhere           
ACCEPT     udp  --  anywhere             anywhere            udp spts:1024:65535 dpt:domain
ACCEPT     all  --  anywhere             anywhere            state RELATED,ESTABLISHED
ACCEPT     tcp  --  anywhere             anywhere            state NEW,RELATED,ESTABLISHED multiport dports www,https multiport sports 1024:65535
DROP       all  --  anywhere             anywhere           


I'm basically worried about the `ACCEPT all' rules in the filter tables and I'm wondering if they are what they appears to be - and if so why?

Should I be worried?


Top
   
 Post subject: Re: iptables firewall
PostPosted: Tue Mar 10, 2009 3:40 pm 
Offline
Junior Member

Joined: Tue Dec 09, 2008 2:33 pm
Posts: 49
Website: http://www.ragtop.org
Location: Gilbert, AZ
davejones wrote:
Should I be worried?


Probably not. If you are using the script from the wiki then that rule is accepting packets from loopback (your own machine). Run your iptables list with a "-v" so it shows the interfaces and packet counts so you can see if everything is hitting that first rule or not.


Top
   
 Post subject:
PostPosted: Tue Mar 10, 2009 3:41 pm 
Offline
Newbie

Joined: Tue Mar 10, 2009 3:19 pm
Posts: 2
Ah brilliant. Thanks for that explanation jsr!


Top
   
 Post subject:
PostPosted: Tue Mar 10, 2009 10:02 pm 
Offline
Senior Member

Joined: Mon Feb 02, 2009 1:43 am
Posts: 67
Website: http://fukawi2.nl
Location: Melbourne, Australia
The default policy for all your chains is ACCEPT, so the ACCEPT rules make no difference really ;)

You need to change your default policy to REJECT or DROP for the rules to actually matter:
Code:
iptables -P INPUT DROP
iptables -P FORWARD DROP
iptables -P OUTPUT DROP

Forgive me if I'm telling you something you already know, but you didn't mention it in your post, so I figured I better say something...


Top
   
 Post subject:
PostPosted: Tue Mar 10, 2009 11:14 pm 
Offline
Junior Member

Joined: Tue Dec 09, 2008 2:33 pm
Posts: 49
Website: http://www.ragtop.org
Location: Gilbert, AZ
The final rule is to drop everything, which basically accomplishes the same thing as setting the default.


Top
   
 Post subject:
PostPosted: Tue Mar 10, 2009 11:20 pm 
Offline
Senior Member

Joined: Mon Feb 02, 2009 1:43 am
Posts: 67
Website: http://fukawi2.nl
Location: Melbourne, Australia
jsr wrote:
The final rule is to drop everything, which basically accomplishes the same thing as setting the default.

Ah, yes... Ignore me :oops:


Top
   
Display posts from previous:  Sort by  
Post new topic  Reply to topic


Who is online

Users browsing this forum: No registered users and 1 guest


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Search for:
Jump to:  
RSS

Powered by phpBB® Forum Software © phpBB Group