Configuring IPv6 on Ubuntu and CentOS KVM / Cloud Server

IPv6 Configuration Wallpaper

once we buy a machine that is virtual) or virtual private server (VPS) from a provider, there are times whereby we have to configure the IPv6 address manually on the server. This may be due to the fact on the network level that IPv6 is not enabled by default on the server, even if the provider already supports it. Your provider may be providing you with a IPv6 that is static for you to configure manually on the server.

Below article contains step-by-step instructions on how to set up a static IPv6 address on servers running Ubuntu and CentOS operating systems. The command examples here were done on Ubuntu and CentOS machines that are virtual in SimplerCloud. Since a root account ended up being utilized, the sudo demand ended up being omitted of all associated with actions. If you use a user that is non-root sudo access on an Ubuntu environment, please append sudo in front of each command (e.g. sudo ifconfig -a instead of ifconfig -a).

What We Need To Prepare

We need to get a IPv6 that is static become assigned to the host. This project is generally carried out by the ongoing service provider. Similar to IPv4, the information required for IPv6 settings consists of the IPv6 address itself, the subnet mask (for example, /64) and the default gateway. Note that your provider might be assigning a/( that is whole subnet for your requirements, if that’s the way it is, you’ll simply pick one IPv6 target inside the /64 subnet to be utilized for the host.

On below examples, we’ll make use of below IPv6 details become configured regarding the servers.

For the Ubuntu test host :

IPv6 target: 2400:c980:0000:0002::180
 Subnet mask: /64
 Default gateway: 2400:c980:0000:0002::1

For the CentOS test host :

IPv6 target: 2400:c980:0000:0002::190
 Subnet mask: /64
 Default gateway: 2400:c980:0000:0002::1

Configure IPv6 on Ubuntu

To configure fixed IPv6 deal with on a server or digital device operating Ubuntu Linux os, we have to login on host making use of SSH as root. The file that individuals should change is “/etc/network/interfaces”.

Firstly, let’s make a backup content associated with “/etc/network/interfaces” file first by issuing this demand :

cp /etc/network/interfaces /etc/network/interfaces.bak

001-CopyInterfacesFile

We can confirm your file happens to be supported by visiting the /etc/network folder after which kind "ls -la".

002-CheckIfBackupCreated

We are able to start the /etc/network/interfaces file making use of our text that is favourite editor either “nano” or “vi”. For most users, using the “nano” text editor would be much easier.

nano /etc/network/interfaces

Below is the typical content of /etc/network/interfaces on an Ubuntu server, depending on the network that is current associated with host. That we want to configure on the server.( as you might have noticed, only IPv4 is being configured there, while the IPv6 is not yet configured

003-EtcNetworkInterfacesBefore

What we can do is to add below lines at the end of the file

# IPv6 for eth0
 iface eth0 inet6 static
 pre-up modprobe ipv6
 address 2400:c980:0000:0002::180
 netmask 64
 gateway 2400:c980:0000:0002::1

004-EtcNetworkInterfacesAfter

Kindly noted that 2400:c980:0000:0002::180 is the static IPv6 address*****)

Save the file. Then press “Y” to save the changes.( if you are using nano, press “Ctrl-X” to exit, and*****)

005-SaveTheChanges

For Ubuntu 12.04, you’ll issue below demand to stimulate the modifications*****) that is:(***********)/etc/init.d/networking restart

006-NetworkingRestart

For Ubuntu 14.04, you would need to restart your server for the changes to take effect.

You can then verify if the correct IPv6 address has been installed on your server by issuing below command:

ifconfig eth0

007-IfconfigResult

inet6 addr: 2400:c980:0:2::180/64 Scope:Global

and verify that the correct IPv6 address is being shown.

Configure IPv6 on CentOS

To configure static IPv6 address on a server or machine that is virtual CentOS Linux os, we have to login on host making use of SSH as root. There are two main files that individuals should change:

  1. /etc/sysconfig/network: switch on IPv6 networking and IPv6 that are disable.
  2. /etc/sysconfig/network-scripts/ifcfg-eth0: Set static IPv6 address and the default gateway.

First, let us make a copy that is backup of files very first.

cp /etc/sysconfig/network /etc/sysconfig/network.bak
 cp /etc/sysconfig/network-scripts/ifcfg-eth0 /etc/sysconfig/network-scripts/ifcfg-eth0.bak

008-BackupFiles

After which, we could make use of our text that is favourite editore.g. “nano”) to modify the /etc/sysconfig/network file.

nano /etc/sysconfig/network

009-EditEtcSysconfigNetworkFile

Default configuration would be like this :

NETWORKING=yes
 HOSTNAME=your.server.hostname

010-DefaultEtcSysconfigNetworkFile

Add these following lines after the line that is second*****)

NETWORKING_IPV6=yes IPV6_AUTOCONF=no

So it’s going to be such as this:

NETWORKING=yes
 NETWORKING_IPV6=yes
 IPV6_AUTOCONF=no
 HOSTNAME=your.server.hostname

011-EtcSysconfigNetworkFileAfterChange

Open the /etc/sysconfig/network-scripts/ifcfg-eth0 file making use of your favourite text editor (age.g. nano):

nano /etc/sysconfig/network-scripts/ifcfg-eth0

The typical normal system setup would frequently be according to below screenshot:

012-Ifcfg-Eth0

The typical normal system setup would frequently be according to below screenshot:

IPV6ADDR=2400:c980:0000:0002::190
 IPV6_DEFAULTGW=2400:c980:0000:0002::1

Note that 2400:c980:0000:0002::190 could be the fixed IPv6 target which we now have assigned on host.

The entire file following the modifications is such as this:

013-Ifcfg-Eth0-After

Save the file, after which issue below demand to help make the modifications to just take impact:

service system restart

014-ServiceNetworkRestart

We are able to confirm in the event that proper IPv6 target happens to be set up regarding the host by issuing below demand:

ifconfig eth0

015-IfconfigEth0

Note the line:

inet6 addr: 2400:c980:0:2::190/64 Scope:Global

and confirm your proper IPv6 target will be shown.

Verify the IPv6 Connectivity

To verify you can perform some ping and traceroute tests to some IPv6-enabled sites that you have IPv6 connectivity and your static IPv6 address is working. In Linux operating systems, take note to use “ping6” and “traceroute6” commands for IPv6 network, as opposed to the normal “ping” and “traceroute” commands for IPv4 network.

ping6 google.com
 Traceroute6.com( that is google************) 

016-Ping6Traceroute6Results

That’s it and revel in.

Disclaimer : this really is another guest that is great article by Indra Pramana from SimplerCloud.com, a cloud servers provider from Singapore with solutions built through the ground as much as offer really real-time, scalable and simply managed cloud infrastructure for start-ups, designers and company throughout Asia.

LEAVE A REPLY

Please enter your comment!
Please enter your name here