Linux Netfilter discussions
 help / color / mirror / Atom feed
From: "Gilad Benjamini" <gilad.benjamini@gmail.com>
To: BrainChild@Skyler.com, netfilter@vger.kernel.org
Subject: RE: iptables terminating targets
Date: Mon, 5 Jan 2009 12:22:59 -0800	[thread overview]
Message-ID: <49626c31.1e078e0a.2f44.ffff94af@mx.google.com> (raw)
In-Reply-To: <09c4m418mn35t08207s4v176f82e1jtrn7@4ax.com>

> <trimmed>
> ...
> <trimmed>
 
> Here's what I don't understand: From what I read, terminating targets
> like ACCEPT and DROP stop consideration of any further rules in any
> tables and chains.  It also seems like all the built-in chains have a
> policy of ACCEPT by default, and the policy target is effective if no
> rules match in the chain.  I have seen no way to _remove_ a policy
> from a chain - only _change_ the policy target.  This seems to lead to
> the (obviously false) conclusion that only one built-in chain will
> ever be considered - the first one.  If a rule doesn't terminate, the
> policy will!

Up to the (false) conclusion, all your assumptions are true. I believe I see
the source of your confusion, which was also mine when I started with
iptables.
Each built-in chain is traversed at a different location (a.k.a. hook) in
the packet path. See two graphic variations of this below.
A terminating target means that the packet has completed traversing the
current built-in chain, but might be further processed by other chains, by
means of a different hook. 
Specifically for the FILTER table, which is your main concern for a
firewall, its hooks are located such that each packet goes through exactly
one built-in chain of the table.

- http://jengelh.medozas.de/images/nf-packet-flow.png
- http://linux-ip.net/nf/nfk-traversal.png 

HTH,
Gilad



  parent reply	other threads:[~2009-01-05 20:22 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-01-05 16:24 Q: iptables terminating targets Indiana Epilepsy and Child Neurology
2009-01-05 16:31 ` Marek Kierdelewicz
2009-01-05 20:22 ` Gilad Benjamini [this message]
     [not found]   ` <4ls4m4hj393j1ekptolcv97rsk8je5isuv@4ax.com>
2009-01-05 20:57     ` Gilad Benjamini

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=49626c31.1e078e0a.2f44.ffff94af@mx.google.com \
    --to=gilad.benjamini@gmail.com \
    --cc=BrainChild@Skyler.com \
    --cc=netfilter@vger.kernel.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