Linux Netfilter discussions
 help / color / mirror / Atom feed
From: Richard Hector <rhector@paradise.net.nz>
To: netfilter@lists.netfilter.org
Subject: Re: detect original chain after jump?
Date: Sun, 28 Mar 2004 02:20:13 +1200	[thread overview]
Message-ID: <20040327142013.GA6033@fake> (raw)
In-Reply-To: <200403271351.32300.Antony@Soft-Solutions.co.uk>

On Sat, Mar 27, 2004 at 01:51:32PM +0000, Antony Stone wrote:
> On Saturday 27 March 2004 1:38 pm, Richard Hector wrote:
> 
> > This means that early on, I have something like:
> >
> > iptables -A INPUT -j protocol
> > iptables -A FORWARD -j protocol
> >
> > iptables -A protocol -p tcp --dport 22 -j ssh
> >
> > But then I get a bit stuck. I need to then do different things depending
> > on the source and destination - which includes whether this packet is
> > arriving locally or being forwarded. Therefore it would be useful to
> > know whether this packet started out in the INPUT or FORWARD chain - but
> > that info seems to have been lost with the jump.
> >
> > Is there any way to regain that?
> 
> Surely the destination address is all you need for this?

I suppose so. It's just that the INPUT chain is a handy way to group all the
local interfaces and addresses. Without it, I multiply the number of rules by
the number of possible local addresses that could be used.

> Are you sure that combining INPUT and FORWARD rules like this is really what 
> you want to do?

No :-)

However, that's why I'm experimenting; I'll see what version looks simplest
and most intuitive of the likely possibilities I can think of.

> I would have thought the two were sufficiently different (what traffic you 
> allow in to your firewall, compared to what traffic you allow through it to 
> elsewhere) that it would be worth writing separate rulesets for the two.

That may well be true - especially if the firewall is sufficiently
dedicated to its firewalling. Mine is also a bounce point for SSH, a
DHCP server and an NTP server; not quite as clean as it could/should be.

Many thanks,

Richard



  reply	other threads:[~2004-03-27 14:20 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2004-03-27 13:38 detect original chain after jump? Richard Hector
2004-03-27 13:51 ` Antony Stone
2004-03-27 14:20   ` Richard Hector [this message]
2004-03-27 14:28     ` Antony Stone
2004-03-27 15:07       ` rrecaba
2004-03-27 15:14         ` Antony Stone
2004-03-29  1:27           ` Double Match or jump (was Re: detect original chain after jump?) rrecaba

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=20040327142013.GA6033@fake \
    --to=rhector@paradise.net.nz \
    --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