All of lore.kernel.org
 help / color / mirror / Atom feed
From: Jan Engelhardt <jengelh@inai.de>
To: Wouter <wouter-netfilter@publica.duodecim.org>
Cc: netfilter@vger.kernel.org
Subject: Re: module order: tcp/conntrack vs. conntrack/tcp
Date: Mon, 2 Jul 2012 14:16:10 +0200 (CEST)	[thread overview]
Message-ID: <alpine.LNX.2.01.1207021414160.9210@frira.zrqbmnf.qr> (raw)
In-Reply-To: <9bfb14742a7ec35d775699fc955f437b@localhost>

On Monday 2012-07-02 14:02, Wouter wrote:

>I'm wondering about the practical difference between these seemingly
>equivalent rules (notice the module order):
>
>iptables -A INPUT -i eth0 -p tcp --dport 8140 -m state --state NEW -j
>ACCEPT
>iptables -A INPUT -i eth0 -p tcp -m state --state NEW -m tcp --dport 8140
>-j ACCEPT
>
>While I always use the form of rule 1 (filter first, then state NEW), I
>found some systems configured like rule 2 – which appears to have the same
>end result – and I wonder if rule 2 (state first, then filter) has any side
>effects or causes more overhead.

The use of -m conntrack (state is obsolete) is cheaper than people 
think, because the ct belonging to a packet is already long determined, 
so looking at the state is quite simple.

  reply	other threads:[~2012-07-02 12:16 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-07-02 12:02 module order: tcp/conntrack vs. conntrack/tcp Wouter
2012-07-02 12:16 ` Jan Engelhardt [this message]
2012-07-02 12:49   ` Wouter
2012-07-03  1:57   ` Julien Vehent
2012-07-03 11:56     ` Jan Engelhardt
2012-07-04  5:47       ` Julien Vehent

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=alpine.LNX.2.01.1207021414160.9210@frira.zrqbmnf.qr \
    --to=jengelh@inai.de \
    --cc=netfilter@vger.kernel.org \
    --cc=wouter-netfilter@publica.duodecim.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.