Enabling IPv6 support for IPv4-only apps on Linux
Coming from the Apple ecosystem, this is solved on macOS&#x2F;iOS by a native implementation of 464XLAT on the device (particularly the CLAT relay part.)<p>If you have a working NAT64&#x2F;DNS64 setup, macOS can make a AAAA (ipv6 DNS) request to ipv4only.arpa, and observe the form the result comes back as, in order to learn the IPv6 prefix used for IPv4 compatibility on the network (eg. 64:ff9b::&#x2F;96), and if it&#x27;s not given an IPv4 address via DHCP, will set up a local interface at 192.0.0.1 that is the default route for all IPv4 traffic. Anything sent to this interface will translate the address to the corresponding IPv6 compatibility address and send it to your IPv6 router (which should use NAT64 to send it to the destination.)<p>In this sense, you don&#x27;t need any IPv4 infrastructure at all in your network (no DHCP, etc) and all traffic on your LAN will be IPv6, but IPv4-only apps (including those that hardcode IPv4 addresses and try to connect to them) work fine.<p>A quick web search says that linux has a similar thing implemented as a userspace daemon (clatd) which presumably does something similar, and importantly doesn&#x27;t rely on LD_PRELOAD hacks like this article suggests (LD_PRELOAD doesn&#x27;t work with static binaries like those written in Go, for instance.)