Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!


How to get IPv4 connectivity on an IPv6 only VPS.
New on LowEndTalk? Please Register and read our Community Rules.

All new Registrations are manually reviewed and approved, so a short delay after registration may occur before your account becomes active.

How to get IPv4 connectivity on an IPv6 only VPS.

unixfoxunixfox Member
edited May 2020 in Tutorials

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".
Or you may have ordered a VPS that only has IPv6 connectivity and you want to access to a resource only accessible from the "IPv4 world".
Here is how to gain your access back to the "IPv4 world".

Change your name servers(s) to DNS64 name servers(s)

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/.
Note²: You may find a explanation of what is NAT64 and DNS64 on Wikipedia.

  1. Choose a/multiple DNS64 public server(s) that has/have its own NAT64 public service from this list:
  • 2001:67c:2b0::4: provider: trex.fi / Location: Finland (Europe) / Quality of internet connectivity: good
  • 2001:67c:2b0::6: provider: trex.fi / Location: Finland (Europe) / Quality of internet connectivity: good
  • 2001:67c:27e4::64: provider: go6lab.si / Location: Slovenia (Europe) / Quality of internet connectivity: good
  • 2001:67c:27e4::60: provider: go6lab.si / Location: Slovenia (Europe) / Quality of internet connectivity: medium
  1. Replace the current name servers(s) of your /etc/resolv.conf file (old way) or in the configuration file of your network manager with the DNS64 name servers(s) that you chosen earlier.
    If you don't know how to change the name servers then 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.conf file by using chattr +i /etc/resolv.conf after modifying the file.

Add real IPv4 connectivity for applications that works only in IPv4 (optional)

Note: This part of the tutorial only works on Linux distributions that has systemd or Upstart as a service manager (Debian, Ubuntu, CentOS and so on). If you are experienced enough you may "translate" the systemd service file to your service manager.
Note²: If you are using ArchLinux you don't need to follow this part of tutorial because there is a clatd package available on AUR: https://aur.archlinux.org/packages/clatd-git/.

  1. Install make, git, cpan/perl, gcc and tayga from your package manager (Debian/Ubuntu : sudo apt-get install -y make git gcc tayga perl).
  2. Clone the clatd Github repository using: git clone https://github.com/toreanderson/clatd.git
  3. Change your current directory to the new directory called clatd: cd clatd.
  4. Install clatd using sudo make install.
  5. Install the required perl dependencies for clatd: cpan Net::IP Socket6 IO::Socket::INET6 Net::DNS.
  6. Start clatd with sudo systemctl start clatd (systemd) or initctl start clatd (upstart).
  7. Wait around 30 seconds then check if you have IPv4 connectivity using curl: curl -4 google.com.

Troubleshooting if case the curl command doesn't work

  1. Execute systemctl status clatd and check if it say: This system already has IPv4 connectivity; no need for a CLAT.
  2. 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.service file (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.
  3. Reload systemd and restart clatd: sudo systemctl daemon-reload && sudo systemctl restart clatd.
  4. Check if you have IPv4 connectivity: curl -4 google.com.

Comments

  • JarryJarry Member
    edited May 2020

    Another self-promo? Seems like some epidemic is going on LET recently... ;-)

    BTW, just be clear: that this enables IPv6-only client to open connection to IPv4-only server. Not vice-versa! If your VPS has only IPv6 and client is on IPv4-network, he will not be able to reach that vps...

    Thanked by 1webcraft
  • serv_eeserv_ee Member

    I don't even care. I just came here to say I'm stealing that avatar.

    Thanked by 2bdl ralf
  • Is it easier to use CloudFlare if you only want to proxify several web ports?

  • onplusonplus Member

    A list of public usable NAT64 Services.
    https://nat64.xyz/

    And can use websocket proxy with cloudflare
    https://guide.v2fly.org/en_US/advanced/cdn.html

    Thanked by 4unixfox Bertie xms vr10
  • vip3r09vip3r09 Member

    Thanks for sharing

  • IWCTQ4IWCTQ4 Member

    userful

  • unixfoxunixfox Member

    @Jarry said:
    Another self-promo? Seems like some epidemic is going on LET recently... ;-)

    BTW, just be clear: that this enables IPv6-only client to open connection to IPv4-only server. Not vice-versa! If your VPS has only IPv6 and client is on IPv4-network, he will not be able to reach that vps...

    I'm just an average consumer doing a tutorial for other consumers. I'm not affiliate with any providers. The "scaleway example" is just an issue that I encountered myself.

    Indeed this doesn't allow IPv4 clients to connect to the IPv6 only VPS. I would have made it more clear in my tutorial but editing the post is disabled after a few hours of creating a post.

    @Hotmarer said:
    Is it easier to use CloudFlare if you only want to proxify several web ports?

    Like Jarry said, it's not about allowing IPv4 clients to connect to the IPv6 only server but just for the IPv6 only server to have connectivity to the IPv4 servers.

    You may use Cloudflare for allowing IPv4 clients to connect to the services hosted on your IPv6 only server but I think it's better to get a very cheap VPS that has both IPv4 & IPv6 connectivity and use it like a proxy.

  • alexnfalexnf Member

    @Jarry said:
    Another self-promo? Seems like some epidemic is going on LET recently... ;-)

    BTW, just be clear: that this enables IPv6-only client to open connection to IPv4-only server. Not vice-versa! If your VPS has only IPv6 and client is on IPv4-network, he will not be able to reach that vps...

    I guess only third world countrys and ISPs have not implented ipv6 as default for all broadband customers.

    Thanked by 1Daniel15
  • @alexnf said:

    @Jarry said:
    Another self-promo? Seems like some epidemic is going on LET recently... ;-)

    BTW, just be clear: that this enables IPv6-only client to open connection to IPv4-only server. Not vice-versa! If your VPS has only IPv6 and client is on IPv4-network, he will not be able to reach that vps...

    I guess only third world countrys and ISPs have not implented ipv6 as default for all broadband customers.

    Third World countries to include (BT) UK.

    Thanked by 2Ouji maverickp
  • vyas11vyas11 Member
    edited May 2020

    @alexnf said:

    @Jarry said:
    Another self-promo? Seems like some epidemic is going on LET recently... ;-)

    BTW, just be clear: that this enables IPv6-only client to open connection to IPv4-only server. Not vice-versa! If your VPS has only IPv6 and client is on IPv4-network, he will not be able to reach that vps...

    I guess only third world countrys and ISPs have not implented ipv6 as default for all broadband customers.

    Speaking Third World Countries...
    Has CC started offering ipv6 ?

  • alexnfalexnf Member

    @vyas11 said:

    @alexnf said:

    @Jarry said:
    Another self-promo? Seems like some epidemic is going on LET recently... ;-)

    BTW, just be clear: that this enables IPv6-only client to open connection to IPv4-only server. Not vice-versa! If your VPS has only IPv6 and client is on IPv4-network, he will not be able to reach that vps...

    I guess only third world countrys and ISPs have not implented ipv6 as default for all broadband customers.

    Speaking Third World Countries...
    Has CC started offering ipv6 ?

    Who is cc?

  • @alexnf said:
    Who is cc?

    ColoCrossing

  • ClouviderClouvider Member, Patron Provider

    @AlwaysSkint said:

    @alexnf said:

    @Jarry said:
    Another self-promo? Seems like some epidemic is going on LET recently... ;-)

    BTW, just be clear: that this enables IPv6-only client to open connection to IPv4-only server. Not vice-versa! If your VPS has only IPv6 and client is on IPv4-network, he will not be able to reach that vps...

    I guess only third world countrys and ISPs have not implented ipv6 as default for all broadband customers.

    Third World countries to include (BT) UK.

    Hm? BT is the top IPv6 eyeball we see here @ 62240 ?
    They do it natively first years, without end user having to request it.

    Thanked by 1YellowHummingbird
  • @Clouvider said:

    @AlwaysSkint said:

    @alexnf said:

    @Jarry said:
    Another self-promo? Seems like some epidemic is going on LET recently... ;-)

    BTW, just be clear: that this enables IPv6-only client to open connection to IPv4-only server. Not vice-versa! If your VPS has only IPv6 and client is on IPv4-network, he will not be able to reach that vps...

    I guess only third world countrys and ISPs have not implented ipv6 as default for all broadband customers.

    Third World countries to include (BT) UK.

    Hm? BT is the top IPv6 eyeball we see here @ 62240 ?
    They do it natively first years, without end user having to request it.

    Yeah - I've had v6 on BT for a few years, it just happened automatically overnight one day. I was very pleased to see it - although a lot of universities in the UK still haven't got working v6 for their student wifi, so we're still some way off full adoption.

    Thanked by 1Clouvider
  • AlwaysSkintAlwaysSkint Member
    edited May 2020

    Well I don't have IPv6 on TalkTalk and from my research it was down to BT Wholesale not implementing it nor having a roadmap to it. (Last looked a year ago, or thereabouts.) Goes off to re-enable on my router to see what happens..

  • ClouviderClouvider Member, Patron Provider
    edited June 2020

    @AlwaysSkint said:
    Well I don't have IPv6 on TalkTalk and from my research it was down to BT Wholesale not implementing it nor having a roadmap to it. (Last looked a year ago, or thereabouts.) Goes off to re-enable on my router to see what happens..

    TalkTalk runs their own network on top of BTW.

    I use Zen at home, that’s over BTW, and have absolutely no issues with my native IPv6.

    Just change the ISP ;-)

    Thanked by 1AlwaysSkint
  • CoreyCorey Member

    clatd implements the CLAT component of the 464XLAT network architecture
    specified in RFC 6877. It allows an IPv6-only host to have IPv4
    connectivity that is translated to IPv6 before being routed to an upstream
    PLAT (which is typically a Stateful NAT64 operated by the ISP) and there
    translated back to IPv4 before being routed to the IPv4 internet.

    So what happens if clatd can't find an upstream PLAT? How does it find the upstream PLAT?

  • @Hotmarer said:
    Is it easier to use CloudFlare if you only want to proxify several web ports?

    You cannot access github and dockerhub without ipv4 connection.

  • samKsamK Member

    To connect to to your VPS from IPv4 via tunneling, you need to enter provided address/hostname and port number in your SSH client program (like PuTTY or WinSCP). Then all IPv4<=>IPv6 SSH connection traffic goes via our tunneling service and you will be able to access your IPv6 VPS from IPv4 address space.

  • Nemo_bisNemo_bis Member
    edited June 2022

    Thanks for this guide! Note that nowadays https://github.com/toreanderson/clatd#installation recommends to use:

    sudo make -C clatd install installdeps

    This is faster because e.g. on Debian it installs perl packages from the Debian repositories, instead of building them locally.

    Also, on recent (systemd) OS it's probably better to edit /etc/dhcp/dhclient.conf , see /etc/dhcp/dhclient.conf for examples.

    P.s.: Apparently the moderators were unhappy about this post, deemed to be "necroposting". Sorry for whoever was hurt by my post. (I couldn't find what definition of necroposting is used here. I thought OP's guide is obviously still relevant and an update on the installation methods could only be useful.)

  • I think this configuration is no more working at scaleway, been trying both method change the resolv.conf and the clatd, both are not working and unable to communicate with Ipv4 address like docker hub. or does anyone have able to make this working on scaleway?, maybe can share the configuration. thank you

Sign In or Register to comment.