Some hosting providers like scaleway allows to remove the IPv4 from the VPS in order to save 1€/month but doing this will result in losing connectivity to the "IPv4 world". Here is how to gain your access back to the "IPv4 world".
Note: You may choose multiple nameservers.
Note²: You may deploy your own DNS64 & NAT64 server on a separate server by following this tutorial (untested): https://packetpushers.net/nat64-setup-using-tayga/.
- Choose a DNS64 public server that has its own NAT64 public service from this list:
| Nameserver | Provider | Location | Quality of internet connectivity |
|---|---|---|---|
| 2001:67c:2b0::4 & 2001:67c:2b0::6 | trex.fi | Finland (Europe) | Good |
| 2001:67c:27e4::64 | go6lab.si | Slovenia (Europe) | Good |
| 2001:67c:27e4::60 | go6lab.si | Slovenia (Europe) | Medium |
- Add the nameserver(s) to your
/etc/resolv.conffile or in the configuration file of your network manager. Search on your prefered search engine a tutorial on how to change the DNS servers of your Linux distribution.
If you don't want to bother with configuring your network manager then you may deny any access to the/etc/resolv.confby usingchattr +i /etc/resolv.confafter modifying the file.
Note: This tutorial only works on Linux distributions that has systemd or Upstart as a service manager.
Note²: If you are using ArchLinux you don't need to follow the tutorial because there is a clatd package on AUR: https://aur.archlinux.org/packages/clatd-git/.
- Install
make,git,cpan/perl,gccandtaygafrom your package manager (Debian/Ubuntu :sudo apt-get install -y make git gcc tayga perl). - Clone the
clatdGithub repository using:git clone https://github.com/toreanderson/clatd.git - Change your current directory to the new directory called
clatd:cd clatd. - Install clatd using
sudo make install. - Install the required perl dependencies for clatd:
cpan Net::IP Socket6 IO::Socket::INET6 Net::DNS. - Start clatd with
sudo systemctl start clatd(systemd) orinitctl start clatd(upstart). - Check if you have IPv4 connectivity using curl:
curl -4 google.com.
- Execute
systemctl status clatdand check if it say:This system already has IPv4 connectivity; no need for a CLAT. - If that's the case then add
ExecStartPre=/bin/sh -c "sleep 30s && ip route del 0/0"after[Service]in the/etc/systemd/system/clatd.servicefile (this only works on systemd). If that's not the case then try to change the DNS64 nameserver with another one from the list above then restart clatd (sudo systemctl restart clatd) and if it still doesn't work then you are out of luck because your hosting provider doesn't support the NAT64 protocol. - Reload systemd and restart clatd:
sudo systemctl daemon-reload && sudo systemctl restart clatd. - Check if you have IPv4 connectivity:
curl -4 google.com.
Here there,
Thanks for your great tutorial first. I did what you said above, but still failed to the ip4 connectivity. Any ideas how to debug it? Thanks !
A startdust instance from scaleway