LinuxQuestions.org
Help answer threads with 0 replies.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Security
User Name
Password
Linux - Security This forum is for all security related questions.
Questions, tips, system compromises, firewalls, etc. are all included here.

Notices


Reply
  Search this Thread
Old 03-21-2003, 06:51 AM   #1
dunkyb
Member
 
Registered: Nov 2002
Distribution: Debian testing.
Posts: 143

Rep: Reputation: 15
iptables rule order


Hello .. would just like to clarify this with an iptables guru:

Should an ESTABLISHED,RELATED rule appear first in the rule list, or a "specific" rule?

such as:

iptables -A INPUT -i eth1 -p tcp --dport 8000 -j ACCEPT
iptables -A INPUT -i eth1 -p udp --dport 27960 -j ACCEPT
iptables -A INPUT -i eth1 -m state --state ESTABLISHED,RELATED -j ACCEPT

Should the ESTABLISHED,RELATED rule become first or last in the ruleset? Because it gets the most hits (when i do iptables -vL) so does it make sense to put it at the top??

Please note this is not my ruleset, nor is it complete, just using it to illustrate my question.

Cheers
 
Old 03-21-2003, 07:34 AM   #2
Hangdog42
LQ Veteran
 
Registered: Feb 2003
Location: Maryland
Distribution: Slackware
Posts: 7,803
Blog Entries: 1

Rep: Reputation: 422Reputation: 422Reputation: 422Reputation: 422Reputation: 422
I'm no iptables expert by any means, but my understanding is that as soon as iptables finds a rule that matches, it stops looking and goes on to the next packet. So in the example you've got, if you put ESTABLISHED,RELATED rule at the top, iptables would spend less time processing rules. Personally, I have pretty broad rules early in my table and then get more specific.
 
Old 03-21-2003, 07:56 AM   #3
dunkyb
Member
 
Registered: Nov 2002
Distribution: Debian testing.
Posts: 143

Original Poster
Rep: Reputation: 15
Yes, this is what I thought ...

Cheers
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
help with iptables rule!! vishamr2000 Linux - Security 6 11-09-2005 05:34 AM
iptables rule order Kumado Linux - Security 4 10-13-2005 11:12 PM
iptables rule to let samba in phishintrip Linux - Networking 7 10-17-2003 10:25 AM
IPTables Rule... Grim Reaper Linux - Software 8 04-28-2003 12:20 PM
IPTABLES rule file (need help) chris200t Linux - Networking 5 11-11-2002 02:33 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Security

All times are GMT -5. The time now is 04:52 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration