Há esta pergunta no ServerFault do ano de 2012:
What's the practical difference between:
iptables -A INPUT -m conntrack --ctstate RELATED,ESTABLISHED -j ACCEPT
and
iptables -A INPUT -m state --state RELATED,ESTABLISHED -j ACCEPT
Which one is best to use?
A resposta aceita é:
Both use same kernel internals underneath (connection tracking
subsystem).
Header of xt_conntrack.c
:
xt_conntrack - Netfilter module to match connection tracking
information. (Superset of Rusty's minimalistic state match.)
So I would say -- state module is simpler (and maybe less error
prone). It's also longer in kernel. Conntrack on the other side has
more options and features[1].
My call is to use conntrack
if you need it's features, otherwise stick
with state module.
Similar question on netfilter
maillist.
[1] Quite useful like -m conntrack --ctstate DNAT -j MASQUERADE"
routing/DNAT fixup
;-)
Uma das outras respostas leva a este documento sobre iptables
. Diz:
The conntrack
match is an extended version of the state
match, which makes it possible to match packets in a much more granular way. It let's you look at information directly available in the connection tracking system, without any "frontend" systems, such as in the state
match.
Então, acho que isso é verdade (a partir de outra outra resposta):
There is no difference in the outcome of those two rules.
Note que há também um comentário interessante sob a pergunta:
state
is deprecated in favor of conntrack
, and may or may not be compiled in depending on how your kernel was built.