netfilter-devel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Florian Westphal <fw@strlen.de>
To: Pablo Neira Ayuso <pablo@netfilter.org>
Cc: Florian Westphal <fw@strlen.de>,
	Arturo Borrero Gonzalez <arturo@debian.org>,
	Netfilter Development Mailing list
	<netfilter-devel@vger.kernel.org>
Subject: Re: using nft & iptables nat in parallel
Date: Wed, 14 Jun 2017 20:00:10 +0200	[thread overview]
Message-ID: <20170614180010.GA7441@breakpoint.cc> (raw)
In-Reply-To: <20170614171312.GA7062@salvia>

Pablo Neira Ayuso <pablo@netfilter.org> wrote:
> On Wed, Jun 14, 2017 at 01:53:38PM +0200, Florian Westphal wrote:
> > Pablo Neira Ayuso <pablo@netfilter.org> wrote:
> > 
> > > The extra hook has a performance impact though, is it something that
> > > would just go away one x_tables is gone? What is your plan on this?
> > 
> > Once we do it we can't remove it again, because you can have multiple
> > nat base chains after this change, and removing hook and merging it back
> > into the l3 nat code means first chain attaches a null binding again.
> 
> With multiple nat chains, in case of overlap, we would just take the
> last coming in the pipeline. Just like several chains several times
> the same packet from a filter chain, right?

First match would win because nf_nat_initialized() is true, just like:

-j MASQUERADE
-p tcp --dport 42 -j SNAT ... # no-op

> > > On a different front (just an idea), I would really like to provide an
> > > alternative to setting conntrack templates, so we can get rid of
> > > having a chain (hence another hook) just to set the zone. It's just
> > > more cycles on a hook to do something very simple.
> > 
> > I don't think it can be done, the zone id has to be set before conntrack
> > lookup, I see no way to avoid this?
> >
> > So even if we find a way to transport zone id from one hook to the
> > next (sans skb->nfct template) we still need one extra hook to
> > configure/set the zone id to use.
> 
> Can we do this from rule? So we run sort of nf_conntrack_in() from a
> expression that enables tracking? I remember you mentioned about ICMP
> and related traffic, we just have to document how to configure this so
> people don't shoot on the feet, ie. track both tcp and icmp if you
> want to do this right with this selective tracking expressed in
> positive logic (contrary to the notrack, negative, logic).

Hmm, we can discuss this again during nfws, but I abandoned this
idea (it provides too much rope for ppl to hang themselvers with :-) )

> I guess you would need something like this for bridge conntrack
> support, right?

The (inclomplete, sigh) patches have a hybrid solution which is
worst-of-both-worlds hooking-wise, i.e. you do explicit tracking
request but there is still an implicit hook to catch related and
reply traffic.

  parent reply	other threads:[~2017-06-14 18:00 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-06-14  9:24 using nft & iptables nat in parallel Florian Westphal
2017-06-14  9:37 ` Arturo Borrero Gonzalez
2017-06-14  9:58   ` Florian Westphal
2017-06-14 10:40     ` Pablo Neira Ayuso
2017-06-14 11:19       ` Florian Westphal
2017-06-14 11:29         ` Pablo Neira Ayuso
2017-06-14 11:53           ` Florian Westphal
2017-06-14 17:13             ` Pablo Neira Ayuso
2017-06-14 17:44               ` Pablo Neira Ayuso
2017-06-14 18:00               ` Florian Westphal [this message]
2017-06-14 13:22     ` Arturo Borrero Gonzalez

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=20170614180010.GA7441@breakpoint.cc \
    --to=fw@strlen.de \
    --cc=arturo@debian.org \
    --cc=netfilter-devel@vger.kernel.org \
    --cc=pablo@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;
as well as URLs for NNTP newsgroup(s).