Live data from Hacker News

Enabling IPv6 support for IPv4 only apps on Linux

pavel.network

11–20 of 45 posts

Re: Enabling IPv6 support for IPv4 only apps on Linux

#11
post #2

Doesn't xlat do this?

Yes it does. I have no idea what the 'right' way to set that up on linux is though.

yay -S clatd (or apt-get install for debian derivatives)

export YOURFAVORITEDNS=2001:4860:4860::6464

drill -t aaaa ipv4only.arpa @$YOURFAVORITEDNS

clatd dns64-servers=$YOURFAVORITEDNS

Re: Enabling IPv6 support for IPv4 only apps on Linux

#13
post #9

> Luckily for us Linux provides exceptionally easy way to intercept some specific library functions using simple dynamically linked library: LD_PRELOAD Doesn't LD_PRELOAD only work for non-statically linked executables?

Yes. It should work for most binaries that don't link statically with libc.

The point is that e.g. many programs written using Go are not like that.

They should support IPv6 out of the box though.

Re: Enabling IPv6 support for IPv4 only apps on Linux

#14
post #8
post #5

Indeed, the transition to IPv6-only networks is a timely and important step, and this is an interesting approach. In my opinion, NAT64 in combination with DNS64 presents the most practical solution for home networks. This approach can be fully implemented by consumer routers, eliminating the need for any changes to client devices. If router manufacturers were to make NAT64 with DNS64 a default feature or, at the very…

Not just routers: android phones since 4.3 and iOS 12 both include a CLAT implementation to do just that. clatd https://github.com/toreanderson/clatd/ is a nice and practical CLAT implementation: it does not "require" dns64 but can use it for single stateful translation instead of double

Windows 10+ has a native 464XLAT implementation for use with cellular networks as well.

Most of the pieces are in place already but not all clients operate the same way. I think there's stil some streamlining to be done before any ISP will bother implementing such technology into their routers.

Re: Enabling IPv6 support for IPv4 only apps on Linux

#15
post #13
post #9

Earlier quoted context omitted.

Yes. It should work for most binaries that don't link statically with libc.

The point is that e.g. many programs written using Go are not like that. They should support IPv6 out of the box though.

Go doesn't link against libc?

Re: Enabling IPv6 support for IPv4 only apps on Linux

#17
post #8

Earlier quoted context omitted.

Not just routers: android phones since 4.3 and iOS 12 both include a CLAT implementation to do just that. clatd https://github.com/toreanderson/clatd/ is a nice and practical CLAT implementation: it does not "require" dns64 but can use it for single stateful translation instead of double

Windows 10+ has a native 464XLAT implementation for use with cellular networks as well. Most of the pieces are in place already but not all clients operate the same way. I think there's stil some streamlining to be done before any ISP will bother implementing such technology into their routers.

Windows just nails it. Now that I'm spending most of my time on the desktop with Linux, I've tried to get the same results tere and move to IPv6 only: with clatd it's mostly been a smooth ride.

One small issue: I think T-Mobile is giving /56 but for some reason the Qualcomm 5G card only gives /64 through wwan0.

However, checking the IPv6 returned by qmi with `--wds-get-current-settings` returns a different one each time, so I think the embedded Linux inside the Qualcomm cards does SLAAC and the equivalent of net.ipv6.conf.wwan0.addr_gen_mode=3 to randomize the IID for EUI64

Re: Enabling IPv6 support for IPv4 only apps on Linux

#19
post #16

Honest question: Does anybody have experience with this behind an ISP CGNAT network that provides IPV6 as well? I'm getting worn down from trying to deal with CGNAT and IPv4 for my homelab...

I do. Ask your questions.

And please post the results of `dig -t AAAA ipv4only.arpa @$DNS` with $DNS being each of the DNS servers from your ISP:

"Using draft-ietf-behave-nat64-discovery-heuristic, the CLAT discovers the Pref64/n. The CLAT component sends an AAAA query to the DNS64 for the well-known IPv4-only name “ipv4only.arpa”. The Pref64/n is derived from the received AAAA response. The CLAT determines the used address format by searching the received IPv6 addresses for the well-known IPv4 addresses (192.0.0.170 or 192.0.0.171)."

Some ISP provide different pairs of AAAA depending on which of their DNS server you ask (maybe for round-robin load balancing?)

Re: Enabling IPv6 support for IPv4 only apps on Linux

#20

> Luckily for us Linux provides exceptionally easy way to intercept some specific library functions using simple dynamically linked library: LD_PRELOAD Doesn't LD_PRELOAD only work for non-statically linked executables?

Yes, static binaries would require a different hack. I think something like the tampering feature of strace or a kprobe to intercept the syscall would work.
Post reply on HN