From: Guillaume Morin <guillaume@morinfr.org>
To: Paul Dunphy <pdunphy@research.ryerson.ca>
Cc: netfilter@lists.samba.org
Subject: Re: State Match Question
Date: Thu, 6 Jun 2002 22:17:22 +0200 [thread overview]
Message-ID: <20020606201722.GD612@morinfr.org> (raw)
In-Reply-To: <5.1.0.14.0.20020606152834.02c4d128@mailhost.csca.ryerson.ca>
Hi Paul,
Dans un message du 06 jun à 15:44, Paul Dunphy écrivait :
> Could some kind soul please explain to me (or point me to information
> about) what the difference is between filtering on state ESTABLISHED in
> iptables and filtering on ! --syn? In other words, what's the difference
> between saying
>
> iptables -A FORWARD -p tcp -m state --state ESTABLISHED -j ACCEPT
>
> and saying,
>
> iptables -A FORWARD -p tcp ! --syn -j ACCEPT
In the first rule, you let only pass valid TCP packets correponding to a
established connection e.g a ack packet during the connection, a syn/ack
packet during the TCP handshake, a fin/ack at the end of a connection.
The second let every non SYN packet pass. That includes the packets
which are matched by the first rule of course. But invalid packets in
the sense of the connection state (a syn/ack packet without a previoous
syn packet) and packets with nasty flags (NULL, XMAS...) will pass.
That is bad. Always use the state and avoid matching yourself the TCP
flags. Matching both can be interesting e.g -m state --state NEW --syn.
HTH.
--
Guillaume Morin <guillaume@morinfr.org>
A friend in need is a friend indeed. A friend who bleeds is better.
My friend confessed, she passed the test. We will never sever.
(Placebo)
prev parent reply other threads:[~2002-06-06 20:17 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2002-06-06 19:44 State Match Question Paul Dunphy
2002-06-06 20:17 ` Guillaume Morin [this message]
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=20020606201722.GD612@morinfr.org \
--to=guillaume@morinfr.org \
--cc=netfilter@lists.samba.org \
--cc=pdunphy@research.ryerson.ca \
/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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox