Linux Netfilter discussions
 help / color / mirror / Atom feed
From: Jamie Pratt <jamie@nucdc.org>
To: netfilter@lists.netfilter.org
Subject: Re: What does RELATED and ESTABLISHED really mean.
Date: Tue, 09 Dec 2003 10:54:56 -0500	[thread overview]
Message-ID: <3FD5F050.4000600@nucdc.org> (raw)
In-Reply-To: <20031209083954.0b7aa4c0.mgale@utilitran.com>

... straight from the packet-filtering how-to: ( 
http://www.netfilter.org/documentation/HOWTO//packet-filtering-HOWTO.txt  )

  NEW
         A packet which creates a new connection.


      ESTABLISHED
         A packet which belongs to an existing connection (i.e., a reply
         packet, or outgoing packet on a connection which has seen
         replies).


      RELATED
         A packet which is related to, but not part of, an existing
         connection, such as an ICMP error, or (with the FTP module
         inserted), a packet establishing an ftp data connection.


regards,
jamie

Michael Gale wrote:

> Hello,
> 
> 	I have been reading many netfilter documents and books, they all talk about related and established connections. To use them for FTP connections and to simplify rule sets.
> 
> But none explain exactly what an ESTABLISHED or RELATED connection is ?
> 
> Here are my definitions ... please let know if these are correct :)
> 
> ESTABLISHED - This allows return packets from a connection and all proceeding packets.
> 
> Example -- you have a web server on the DMZ network.
> you have the following iptables rules.
> 
> $IPT -t nat -A POSTROUTING -i $EXT_FACE -d X.X.X.X -j SNAT --to-destination 172.16.0.5
> 
> $IPT -A FORWARD -i $EXT_FACE -o $DMZ_FACE -d 172.16.0.5 -p tcp --sport 1024:65535 --dport 80 -m state --state NEW,ESTABLISHED -j ACCEPT
> 
> $IPT -A FORWARD -i $DMZ_FACE -o $EXT_FACE -s 172.16.0.5 -p tcp --sport 1024:65535 --dport 1024:65535 -m state --state ESTABLISHED -j ACCEPT
> 
> This only allow a tcp connection to be setup between a out side client and a web server on the DMZ. It also only allows the web server to respond to a TCP connection on port 80 and does NOT allow the web server to initiated a outgoing TCP connection.
> 
> If I used related it would allow the web server to make a out going TCP connection to the server that made the initial inbound connection  ?
> 
> Sorry -- I hope I explained this well.
> 

-- 




      reply	other threads:[~2003-12-09 15:54 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2003-12-09 15:39 What does RELATED and ESTABLISHED really mean Michael Gale
2003-12-09 15:54 ` Jamie Pratt [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=3FD5F050.4000600@nucdc.org \
    --to=jamie@nucdc.org \
    --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