All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH nf-next 0/3] netfilter: disable parallel use of xtables and nftables nat
@ 2017-12-08 16:01 Florian Westphal
  2017-12-08 16:01 ` [PATCH nf-next 1/3] netfilter: xtables: add and use xt_request_find_table_lock Florian Westphal
                   ` (2 more replies)
  0 siblings, 3 replies; 9+ messages in thread
From: Florian Westphal @ 2017-12-08 16:01 UTC (permalink / raw)
  To: netfilter-devel

The netfilter NAT core cannot deal with both nftables and ip(6)tables nat
at the same time.
When both are active, one of the two will not work, depending on the
order in which the modules were loaded.

NAT hooks install a NAT null binding in case the iptables/nftables
nat chain did not specify a nat mapping.

Null bindings are needed to detect port collsisions between NAT-ed and
non-NAT-ed connections.

This causes nftables NAT rules to not work when iptable_nat module is
loaded, and vice versa because nat binding has already been attached
when the second nat hook is consulted.

The alternative is to allow both at the same time.
This requirs new internal nat hooks to do the null binding, but doesn't
handle the more fundamental issue of precedence.

Example:

iptables -t nat -A POSTROUTING -o ppp0 -j MASQUERADE
nft add rule ip nat postrouting oifname ppp0 ip protocol udp dport 53 snat to 10.1.1.1

should nft override iptables?
What if one is restored before the other (this seems to be the worst part as it could
cause random behaviour with parallel init schemes ...)

So, better explicitly disallow this for now.


^ permalink raw reply	[flat|nested] 9+ messages in thread

end of thread, other threads:[~2017-12-13 16:28 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-12-08 16:01 [PATCH nf-next 0/3] netfilter: disable parallel use of xtables and nftables nat Florian Westphal
2017-12-08 16:01 ` [PATCH nf-next 1/3] netfilter: xtables: add and use xt_request_find_table_lock Florian Westphal
2017-12-09 15:23   ` Pablo Neira Ayuso
2017-12-08 16:01 ` [PATCH nf-next 2/3] netfilter: core: only allow one nat hook per hook point Florian Westphal
2017-12-08 21:28   ` Pablo Neira Ayuso
2017-12-08 21:33     ` Pablo Neira Ayuso
2017-12-08 16:01 ` [PATCH nf-next 3/3] nftables: reject nat hook registration if prio is before conntrack Florian Westphal
2017-12-08 21:22   ` Pablo Neira Ayuso
2017-12-13 16:28     ` Pablo Neira Ayuso

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.