As you can see, we already have one address in the configuration. This is the link-local address and is a mandatory requirement for various routing and protocol functions. This is not our public address; we still need to configure that.

First, you need to set the IPv6 address. Which we provided you on request.

We will configure this using the same ip command that we used to check the address above.

The command to set the IPv6 address is:

ip -6 addr add public_ipv6_address/64 dev eth0

Next, we need to set the route that the VPS will use to send and receive IPv6 traffic. This is done by setting the gateway. Use the value you find labeled “Public IPv6 Gateway” in the command below:

ip -6 route add default via public_ipv6_gateway dev eth0

Your IPv6 connection should now be configured in your VPS. This will be configured until the next boot. Continue on if you want to make these changes persistent.

Making the IPv6 Configuration Persistent

We have now configured our VPS with our IPv6 connection, but our changes will be lost when our server reboots. To make these changes last beyond this session, you will have to edit some configuration files.

If you are on Ubuntu or Debian, you will need to edit the /etc/network/interfaces file. Open this with sudo privileges in your text editor:

sudo nano /etc/network/interfaces

Inside, you will see a section for each of the networks that you are already configured to use. First, look for the dns-nameservers parameter and remove this line from the IPv4 section. We will add it to the IPv6 section instead.

We must add a new section for our IPv6 address. It should look like this:

Save and close the file when you are finished. When your server is rebooted, it should bring up your IPv6 address properly.

Testing the Connection

Whether you enabled IPv6 when the VPS was created or enabled it after the fact, you can test the IPv6 connection in a few ways.

IPv6 communication requires that you have IPv6 enabled and configured at both ends of the connection. Many ISPs do not yet offer IPv6 addresses yet for customers.

You can test whether your home connection supports IPv6 by visiting an IPv6 testing site. Another option is to use the ping6 utility to try to reach Google’s IPv6 name servers:

ping6 2001:4860:4860::8888

Testing with an IPv6 Connection at Both Ends

If your home connection pings correctly or if the test page confirmed an IPv6 connection, then you have IPv6 available through your local provider. In that case, you can test that your VPS’s IPv6 connection is configured correctly by using ping6 to ping the interface:

ping6 public_ipv6_address

You can also SSH directly into the VPS using that address:

ssh root@public_ipv6_address

Testing without an IPv6 Connection on the Local Side

If the test site above told you that you do not have IPv6 available, or if when pinging Google’s IPv6 name server you get a message that says:

connect: Network is unreachable

This means that you do not have IPv6 available on your home connection. You can still test the connection from within VPS itself.

Log into the VPS using the control panel console or by using SSH with the IPv4 address:

ssh root@public_ipv4_address

From within the VPS, you can test that it can reach the Google IPv6 name server:

ping6 2001:4860:4860::8888

If this is successful, it means that your IPv6 is configured correctly. It will be able to communicate with other sites and servers that have IPv6 enabled throughout the internet.

Conclusion

IPv6 should now be up and running on your VPS. This will allow you to communicate using this version of the protocol while maintaining your IPv4 connectivity. Even if you do not have an IPv6 connection on your local computer, configuring IPv6 can allow you to more broadly communicate.