How to add IPv6 on Ubuntu 16.04

Estimated reading time: 1 min

Introduction

Nowadays it became more important to configure your server with IPv6 and make it accessible via IPv6. To achieve this you can use this article to configure IPv6 for your Ubuntu server.

Prerequisites

  • Root user or a user which has root privileges to make changes to the network interface.
  • Working SSH connection to the server

Step 1 – Contact Support for an IPv6

If you do not have an IPv6 address assigned, the first step is to send an email to [email protected] in order the get the required information for configuring your server with IPv6.

Step 2 – Log in to your server

Open a terminal and log in to your server using SSH

ssh root@ip_address_or_domain

Step 3 – Configure network configuration

Open your network interface file with your favorite editor. We have used nano in our example.

nano /etc/network/interfaces

The file should be similar to configuration file below:

auto ens18
iface ens18 inet static
 address 193.33.61.xxx
 netmask 255.255.255.0
 gateway 193.33.61.1
 dns-nameservers 89.207.128.252 89.207.130.252

To add IPv6 we have to add a new block with the IPv6 configuration which you received from step 1. The network interface can be different on your installation on our installation the network interface is ens18

iface ens18 inet6 static
 address 2a00:7b80:xxx:xxx::xxx
 netmask 48
 gateway 2a00:7b80:xxx::1

Step 4 – Apply the changes

To apply the new changes we have to restart the network service of our server. This can be performed with the following command:

systemctl restart networking

Step 5 – Verify IPv6 on your Server

The final step is to check whether the configured IPv6 is working. If your own working station is supporting IPv6 you can test it through your terminal. You can find the commands below per Operating System.

Windows:

ping -6 2a00:7b80:451:1::8

Linux:

ping6 2a00:7b80:451:1::8

MacOS:

ping6 2a00:7b80:451:1::8

Conclusion

If you followed this article you should have a working IPv6 address on your server. This allows you to enable IPv6 in software which supports IPv6. For example, you can serve now Websites via IPv6 connection.

Was this article helpful?
Dislike 2
Views: 13415

Reader Interactions

Leave a Reply

Your email address will not be published. Required fields are marked *