Linux Netfilter discussions
 help / color / mirror / Atom feed
From: Antony Stone <Antony@Soft-Solutions.co.uk>
To: netfilter@lists.netfilter.org
Subject: Re: Firewall Script Help
Date: Mon, 8 Mar 2004 20:32:57 +0000	[thread overview]
Message-ID: <200403082032.57107.Antony@Soft-Solutions.co.uk> (raw)
In-Reply-To: <200403082012.34162.lists@edeca.net>

On Monday 08 March 2004 8:12 pm, David Cannings wrote:

> >     0     0 DROP       tcp  --  any    any     anywhere
> > anywhere           tcp flags:FIN,ACK/FIN
>
> As I understand it, this means "check the flags FIN and ACK, only match if
> FIN is set and ACK isn't".  This would match packets that only have the
> FIN flag set, which I am fairly sure are valid.  I may need correcting on
> this issue, however.

You are correct.

TCP connections start with:
packet 1: SYN (only) from the client
packet 2: SYN/ACK from the server
packet 3: ACK from the client
all further packets have the ACK flag set from both client and server

and then they end with
packet n-3: FIN (only) from the side which wants to stop talking
packet n-2: FIN/ACK from the other side
packet n-1: FIN (only) from the other side (to confirm it will stop talking 
too)
packet n: FIN/ACK from the side which ended the communication

(Although note that the final two packets are optional and often not seen, 
indeed often blocked by netfilter because by that time it thinks the 
connection is no longer ESTABLSIHED.)

Regards,

Antony.

-- 
What is this talk of "software release"?
Our software evolves and matures until it is capable of escape, leaving a 
bloody trail of designers and quality assurance people in its wake.

                                                     Please reply to the list;
                                                           please don't CC me.



  reply	other threads:[~2004-03-08 20:32 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2004-03-08 18:47 Firewall Script Help Christopher Davis
2004-03-08 18:49 ` David Cannings
2004-03-08 19:19   ` Christopher Davis
2004-03-08 20:12     ` David Cannings
2004-03-08 20:32       ` Antony Stone [this message]
2004-03-09  4:34   ` Mark E. Donaldson
2004-03-08 18:51 ` Aldo S. Lagana
  -- strict thread matches above, loose matches on Subject: below --
2004-03-08 21:14 cldavis
2004-03-08 22:06 ` Antony Stone

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=200403082032.57107.Antony@Soft-Solutions.co.uk \
    --to=antony@soft-solutions.co.uk \
    --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