From: Anders Fugmann <afu@fugmann.dhs.org>
To: Tony Clayton <tony-netfilter@enfusion-group.com>
Cc: netfilter@lists.netfilter.org
Subject: Re: lifecycle of a packet
Date: Fri, 10 Jan 2003 01:33:29 +0100 [thread overview]
Message-ID: <3E1E14D9.3060705@fugmann.dhs.org> (raw)
In-Reply-To: <1042152892.3e1dfdbc6f5d1@webmail.enfusion-group.com>
Tony Clayton wrote:
<lots of info on chain traversal>
>
> This is quite interesting, and not at all what I was expecting based on
> what I'd read.
Depends on what you read :-)
>
> I have a list of questions about this behaviour, keeping in mind that
> I'm fairly new to iptables/netfilter:
>
> 1. Why does only the first packet for a TCP/IP connection seem to pass
> through the nat table? Does connection tracking take over if the packet
> is (ESTABLISHED,RELATED) and work some magic under the covers?
Yes. When you change a packet in the nat table, all following packets
are nat'ed automatically. This way you do not have to worry about
natting replys etc.
>
> 2. Why do both OUTPUT and POSTROUTING chains get traversed for packets
> that the firewall sends out? Is this useful at all?
Yes. in POSTROUTING you may not know if the pakcet has been generated
locally or not. However in the mangle-output chain you do. Another usage
that cannot be done in postrouting is alterations to the packet before
it hits the filter-output chain. The can e.g be used un conjunktion with
packet marking:
iptables -t mangle -a OUTPUT -j MARK --set-mark 0x01
iptables -t filter -a OUTPUT -m mark --mark 0x01 -j ACCEPT.
(Ok - this example is very simple, but still - its imposible without the
mangle-output chain)
>
> 3. Most of the documents I looked at were fairly old. Is there a
> somewhat recent document that perhaps might benefit from including these
> tests?
Yes. Take a look at Oskar Andreasson's excellent tutorial at:
http://people.unix-fu.org/andreasson/iptables-tutorial/iptables-tutorial.html
Esp. look at the section named: "Traversing of tables and chains"
Hope it helps.
Anders Fugmann
--
Author of FIAIF
FIAIF is an intelligent firewall
http://fiaif.fugmann.dhs.org
next prev parent reply other threads:[~2003-01-10 0:33 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2003-01-09 22:54 lifecycle of a packet Tony Clayton
2003-01-10 0:33 ` Anders Fugmann [this message]
2003-01-10 16:09 ` Oskar Andreasson
2003-01-10 16:52 ` lifecycle of a packet (OT) Anders Fugmann
2003-01-10 19:24 ` tony
2003-01-10 19:37 ` Tony Clayton
2003-01-22 15:51 ` Oskar Andreasson
2003-01-22 16:29 ` Kevin McConnell
2003-01-10 0:47 ` lifecycle of a packet Joel Newkirk
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=3E1E14D9.3060705@fugmann.dhs.org \
--to=afu@fugmann.dhs.org \
--cc=netfilter@lists.netfilter.org \
--cc=tony-netfilter@enfusion-group.com \
/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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.