kleenex
January 5th, 2013, 09:15 PM
Hello, there's something bothering me for a long time. It is about the order of the rules in the packet filter. Honestly, it's about one rule, responsible for RELATED and ESTABLISHED states. Let say, that default policy for INPUT chain is set to DROP. There is also several others rules, for incoming packets like e.g. blocking icmp, invalid packets etc. My question: where I should put this rule:
iptables -A INPUT -i eth0 -m state --state ESTABLISHED,RELATED -j ACCEPTI mean a rules order. This (above) rule should be placed on the beginning or at the end of INPUT chain? I read a lot of iptables HOWTO's, FAQ's and many others. From what I understand, it is better to put this rule at the end of chain, because iptables check for matched rule from the top to bottom, right? I'm so confused.
Generally: From security point of view, it is better to put above rule, at the end or at the beginning of INPUT chain?
iptables -A INPUT -i eth0 -m state --state ESTABLISHED,RELATED -j ACCEPTI mean a rules order. This (above) rule should be placed on the beginning or at the end of INPUT chain? I read a lot of iptables HOWTO's, FAQ's and many others. From what I understand, it is better to put this rule at the end of chain, because iptables check for matched rule from the top to bottom, right? I'm so confused.
Generally: From security point of view, it is better to put above rule, at the end or at the beginning of INPUT chain?