Take the 2-minute tour ×
Unix & Linux Stack Exchange is a question and answer site for users of Linux, FreeBSD and other Un*x-like operating systems.. It's 100% free, no registration required.

If I could list that which iptables rule has how many matched packets, then I could create a better/faster iptables script that's faster. That rule would be at top/first that has the more packets matched.

share|improve this question
add comment

2 Answers 2

up vote 1 down vote accepted

iptables -L -n -v

See also this article: http://greenmice.info/en/node/127, there are some other tips.

share|improve this answer
    
The link you shared seems to be dead. –  Alix Axel Apr 4 at 4:06
add comment

I wouldn't spend all that much time worrying about this. If you have a rule which you know gets hit extremely often (related,established rule for example), you could put that near the top. But in general I highly doubt that any more optimization will really pay off in any way.

share|improve this answer
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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