Re: [RFC net-next v2 00/18] net: introduce ipxlat stateless IPv4/IPv6 translation
From: Ralf Lici
Date: Thu Dec 03 2026 - 13:06:19 EST
Hi Xavier,
Sorry for the slow reply, I wanted a working prototype before answering.
On Mon, 23 Nov 2026 10:27:33 +0800, Xavier HSINYUAN <XavierHsinyuan@xxxxxxxxxxx> wrote:
> Hi Ralf,
>
> Thanks for looking into this!
>
> > Actually v2 has no netdevice attachment any more, the LWT is the only
> > harness in this series.
> >
>
> Ah, I was thinking of a possible future netdev attachment at the time.
> Thanks again for pointing that out.
>
Right, with the engine separate from the harness that is possible now,
and it may be a good follow-up for host CLAT deployments.
> > Which setup do you have in mind: SNAT before translation, filtering, or
> > accounting?
>
> My interest is mainly SNAT and counting before translation. Well,
> stateful SNAT seems a bit odd for IPv6, but with multiple upstreams we
> may need to adjust the source prefix based on the selected output
> interface for load balancing or failover.
>
That's a sensible setup, and v2 can't really do it because the selecting
route ends original-family processing before POST_ROUTING.
> That said, separating NAT and translation by utilizing netns and veth
> pairs could already provide this, but letting packets pass through
> original-family POST_ROUTING before translation would make setup (looks)
> simpler.
>
Agreed, that's why I decided to revisit the attachment point. v3
replaces the LWT harness with an nf_tables object (yet another model, I
know), referenced from filter chains at prerouting or postrouting
through objref. At postrouting the original family has already routed,
filtered and NATed the packet, and its conntrack entry is confirmed when
the packet leaves, so replies translated back are established and the
NAT is reversed. The translated packet then goes through the translated
family's routing and hooks, so interface-based decisions work there as
well.
During v1 I was wary of a netfilter attachment because of reinjecting
into the other family but patches 01-03 now take care of that and of the
fragmentation details, which made a hook far more tractable than it
looked. v3 docs will also spell out what each hook placement runs in
each family (which is the per-hook table I promised).
I plan to post v3 by early next week at the latest, with CLAT (NAT44 +
CLAT) and PLAT (NAPT66 + SIIT) examples and selftests covering both.
Your setup is a good real-world case, so feedback would be very welcome.
Thanks!
--
Ralf Lici
Mandelbit Srl