I wish that the IPv6 servers would provide a private IPv4 address that would route outgoing IPv4 traffic. But I found a solution that uses the free DNS64.org servers, not only for DNS, but free IPv4 routing.
This does enable IPv6 forwarding for outgoing IPv4 to IPv6 proxy, as my server only got 1 IPv6 address.
So you have a IPv6 only server, and IPv4 only sites won't load, or even worse, you have a program that uses hardcoded IPv4 address in it, and it won't work just using a DNS64 dns server. The following will setup CLAT on your server that will translate IPv4 address to the IPv6 prefix that is detects for the DNS64 IPv6 range.
This was done on Debian 12, but should also work for Ubuntu. After logging in to your server:
Prep for getting system working
apt update
echo "dns-nameserver 2a01:4f8:c2c:123f::1" >> /etc/network/interfaces
echo "dns-nameserver 2a00:1098:2c::1" >> /etc/network/interfaces
apt install resolvconf git build-essential tayga curl
reboot
After rebooting, we will install CLAT
mkdir ~/src
cd ~/src
git clone https://github.com/toreanderson/clatd
make -C clatd install installdeps
This configures CLAT
cat <<'EOF' > /etc/clatd.conf
clat-v6-addr=fd00::c1a7
proxynd-enable=false
script-up=nft "add table ip6 clatd" ; nft "add chain ip6 clatd POSTROUTING { type nat hook postrouting priority srcnat; }" ; nft "add rule ip6 clatd POSTROUTING masquerade"
script-down=nft 'delete table ip6 clatd'
EOF
echo "net.ipv6.conf.all.forwarding = 1" >> /etc/sysctl.d/00-ip6fwd.conf
sysctl -p
systemctrl restart clatd
Now to test if it works, just run curl 1.1.1.1
. You should then see:
root@srv[Redacted]:~/src# curl 1.1.1.1
<html>
<head><title>301 Moved Permanently</title></head>
<body>
<center><h1>301 Moved Permanently</h1></center>
<hr><center>cloudflare</center>
</body>
</html>
This uses the DNS from nat64.net. and their servers seem to block pings. So that is why I use `curl 1.1.1.1`.