From: Florian Westphal <fw@strlen.de>
To: netfilter-devel@vger.kernel.org
Subject: using nft & iptables nat in parallel
Date: Wed, 14 Jun 2017 11:24:48 +0200 [thread overview]
Message-ID: <20170614092448.GB10130@breakpoint.cc> (raw)
Hi.
As you might know its currently not possible to use iptables
and nft nat at the same time.
I had a look at this and think we should fix this as follows:
1. decouple nat rewrite from nat chain/iptable_nat iteration.
Currently we do this from nf_nat_ipv4/6_fn, so first call (be it nft nat
or ip(6)table_nat) attaches nat translation or a null binding which makes
2nd invocation a no-op.
2. place a l3 protocol independent function that does null binding and
rewrite in nf_nat_core. It can be independent because nf_nat_info has
the l3 information and we don't need to deal with anything special
except hooking at either NFPROTO_IPV4 or V6.
3. make all the nat expressions/targets call a helper function at
init/destroy time so we can register the new rewrite hooks.
This is easy, all these currently call nf_ct_netns_get/put so we
only need to add nf_nat_netns_get/put which calls nf_ct_netns_get
and registers a nat null-bind/rewrite hook.
The downside is that we need one more hook function at priority
NF_IP_PRI_NAT_SRC/DST + 1 in all places except forward.
Another side effect is that this avoids the need to add (in nft case)
the 'empty' nat base chains to take care of reply translation.
Thoughts?
Otherwise I'll have a go at this.
This would also possibly allow us to add nat hooks in the INET family.
next reply other threads:[~2017-06-14 9:25 UTC|newest]
Thread overview: 11+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-06-14 9:24 Florian Westphal [this message]
2017-06-14 9:37 ` using nft & iptables nat in parallel 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
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=20170614092448.GB10130@breakpoint.cc \
--to=fw@strlen.de \
--cc=netfilter-devel@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;
as well as URLs for NNTP newsgroup(s).