Linux Netfilter discussions
 help / color / mirror / Atom feed
From: "Ethy H. Brito" <ethy.brito@inexo.com.br>
To: Andrew Beverley <andy@andybev.com>
Cc: netfilter@vger.kernel.org
Subject: Re: filter before NAT
Date: Tue, 11 Oct 2011 16:52:55 -0300	[thread overview]
Message-ID: <20111011165255.011c284a@pulsar.inexo.com.br> (raw)
In-Reply-To: <1318361872.26402.2504.camel@andybev-desktop>

On Tue, 11 Oct 2011 20:37:52 +0100
Andrew Beverley <andy@andybev.com> wrote:

> > 
> > The problem is that the packets are hooked *after* passing SNAT and
> > all the rules can see is the outbound IP. So no redirects to the
> > corresponding flowid occur.
> > 
> > Is it possible to make the filter rule above "see" the packets before
> > they get NATed?
> > 
> 
> How about marking them using an iptables rule before SNAT? The mangle
> table of POSTROUTING sits before the nat table.

I've already thought about that. The problem is the internal NAT side has
a few thousand clients. To generate an unique mask for those and matching
them later is pretty much a headache. I think.

I also thought in IPMARK but I had to patch the kernel AND iptables and
that is something I am not willing to do since it is a production box.

If nobody came with a better solution I'll have to face the "mark" way. 

Thanx anyway.

Cheers

Ethy


> 
> Andy
> 
> 
> --
> To unsubscribe from this list: send the line "unsubscribe netfilter" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at  http://vger.kernel.org/majordomo-info.html


-- 

Ethy H. Brito         /"\
InterNexo Ltda.       \ /  CAMPANHA DA FITA ASCII - CONTRA MAIL HTML
+55 (12) 3797-6860     X   ASCII RIBBON CAMPAIGN - AGAINST HTML MAIL
S.J.Campos - Brasil   / \ 
 
PGP key: http://www.inexo.com.br/~ethy/0xC3F222A0.asc

  reply	other threads:[~2011-10-11 19:52 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-10-11 14:24 filter before NAT Ethy H. Brito
2011-10-11 19:37 ` Andrew Beverley
2011-10-11 19:52   ` Ethy H. Brito [this message]
2011-10-12  7:01     ` Nikolay Kichukov

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=20111011165255.011c284a@pulsar.inexo.com.br \
    --to=ethy.brito@inexo.com.br \
    --cc=andy@andybev.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