From: "Michael K" <micke@klintan.se>
To: netfilter@lists.netfilter.org
Subject: RE: to understand --tcp-flags
Date: Sun, 1 Jun 2003 01:48:05 +0200 [thread overview]
Message-ID: <000301c327cf$1516b8b0$0200a8c0@klintan.local> (raw)
In-Reply-To: <36427.200.204.151.150.1054419058.squirrel@webmail.4linux.com.br>
> -----Original Message-----
> From: netfilter-admin@lists.netfilter.org
> [mailto:netfilter-admin@lists.netfilter.org] On Behalf Of Ralf Braga
> Sent: Sunday, June 01, 2003 12:11 AM
> To: netfilter@lists.netfilter.org
> Subject: to understand --tcp-flags
>
>
> Hi,
>
> I dont understand this command:
>
> iptables -A INPUT -p tcp --tcp-flags SYN,ACK SYN,ACK \
> -m state --state NEW -j REJECT --reject-with tcp-reset
>
> Because two times is used --tcp-flags SYN,ACK SYN,ACK ?
>
>
> This example will be bloqued packages for flags syn and ack ?
>
> Thanks,
I don't understand this either. But the man page says
--tcp-flags [!] mask comp
Match when the TCP flags are as specified. The first
argument
is the flags which we should examine, written as a
comma-sepa-
rated list, and the second argument is a comma-separated
list of
flags which must be set. Flags are: SYN ACK FIN RST URG
PSH ALL
NONE. Hence the command
iptables -A FORWARD -p tcp --tcp-flags SYN,ACK,FIN,RST
SYN
will only match packets with the SYN flag set, and the
ACK, FIN
and RST flags unset.
So I think that your command meens that SYN and ACK must be set and it
don't mind the others (FIN RST URG PSH) if they are set or unset.
Perhaps its better to understand the --state. The god thing about state
is that it works with all protocols. The states are: NEW, ESTABLISHED,
RELATED, INVALID.
Still need more info on the tcp flags? Read rfc 793
(ftp://ftp.rfc-editor.org/in-notes/rfc793.txt).
/Klintan
prev parent reply other threads:[~2003-05-31 23:48 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2003-05-31 20:01 firewall whoes Jerry M. Howell II
2003-05-31 22:10 ` to understand --tcp-flags Ralf Braga
2003-05-31 22:10 ` Ralf Braga
2003-05-31 23:48 ` Michael K [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='000301c327cf$1516b8b0$0200a8c0@klintan.local' \
--to=micke@klintan.se \
--cc=netfilter@lists.netfilter.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).