How to configure IPv6
Introduction
It is possible to request an IPv6 subnet for your Worldstream server. To request this you can contact us or open a ticket in your my.worldstream account. You can use the IPv6 address next to your IPv4 address. In this article, we will explain how to configure an IPv6 address on your server. Please select the operating system you are using below:
Ubuntu 22.04
Ubuntu 20.04
Ubuntu 18.04
CentOS 8.x
CentOS 7.x
Debian 10.x
Debian 9.x
Ubuntu 22.04
To configure IPv6 on a Ubuntu 22 server you will have to edit the /etc/netplan/01-netcfg.yaml file. In this example, we will use the following IPv6 subnet: 2a00:7c80:0000:0112::/64
In an /64 IPv6 subnet there are an enormous amount of addresses, we will setup one address as an example. For the correct usage please refer to rfc5952. Below an example how to configure IPv6 address 2a00:7c80:0000:0112::2
First open the 01-netcfg.yaml with the text editor you prefer.
[root@worldstream ~]# nano /etc/netplan/01-netcfg.yaml
Add the IPv6 address with any number above 1 under the addresses section.
Ubuntu 22 does not officially use the gateway4 and gateway6 notations anymore.
Instead, you will see a “route:” parameter.
For IPv4 this is usually filled in, but for IPv6 this needs to be added manually.
This should be as follows :
- to: default
via: 2a00:7c80:0000:0112::1
Below an example with an IPv6 address configured.
# This file describes the network interfaces available on your system
# For more information, see netplan(5).
network:
version: 2
renderer: networkd
ethernets:
eno1:
accept-ra: false
addresses:
- 192.168.1.2/24
- 2a00:7c80:0000:0112::2/64
routes:
- to: default
via 192.168.1.1
- to: default
via 2a00:7c80:0000:0112::1
nameservers:
addresses:
- "217.23.0.121"
- "93.190.136.10"
After the IP address is configured you will have to apply the adjustments. You can do this with the following netplan command.
[root@worldstream ~]# netplan apply
To check if IPv6 is configured properly you can check this by using ping6. For example, you can ping the Google IPv6 DNS address.
[root@worldstream ~]# ping6 2001:4860:4860::8888
The response to the ipv6 ping request should be similar to the below example.
[root@worldstream ~]# ping6 2001:4860:4860::8888
PING 2001:4860:4860::8888(2001:4860:4860::8888) 56 data bytes
64 bytes from 2001:4860:4860::8888: icmp_seq=1 ttl=120 time=1.38 ms
64 bytes from 2001:4860:4860::8888: icmp_seq=2 ttl=120 time=1.35 ms
64 bytes from 2001:4860:4860::8888: icmp_seq=3 ttl=120 time=1.36 ms
64 bytes from 2001:4860:4860::8888: icmp_seq=4 ttl=120 time=1.35 ms
Ubuntu 20.04/18.04
To configure IPv6 on a Ubuntu 20 and 18 server you will have to edit the /etc/netplan/01-netcfg.yaml file. In this example, we will use the following IPv6 subnet: 2a00:7c80:0000:0112::/64
In an /64 IPv6 subnet there are an enormous amount of addresses, we will setup one address as an example. For the correct usage please refer to rfc5952. Below an example how to configure IPv6 address 2a00:7c80:0000:0112::2
First open the 01-netcfg.yaml with the text editor you prefer.
[root@worldstream ~]# nano /etc/netplan/01-netcfg.yaml
Add the IPv6 address with any number above 1 under the addresses section and add the IPv6 gateway (::1) after gateway6:
If the line gateway6: is not present in your network file, you should add this. Make sure that each line is correctly aligned. Below an example with an IPv6 address configured.
# This file describes the network interfaces available on your system
# For more information, see netplan(5).
network:
version: 2
renderer: networkd
ethernets:
eno1:
accept-ra: false
addresses:
- 192.168.1.2/24
- 2a00:7c80:0000:0112::2/64
gateway4: 192.168.1.1
gateway6: 2a00:7c80:0000:0112::1
nameservers:
addresses:
- "217.23.0.121"
- "93.190.136.10"
After the IP address is configured you will have to apply the adjustments. You can do this with the following netplan command.
[root@worldstream ~]# netplan apply
To check if IPv6 is configured properly you can check this by using ping6. For example, you can ping the Google IPv6 DNS address.
[root@worldstream ~]# ping6 2001:4860:4860::8888
The response to the ipv6 ping request should be similar to the below example.
[root@worldstream ~]# ping6 2001:4860:4860::8888
PING 2001:4860:4860::8888(2001:4860:4860::8888) 56 data bytes
64 bytes from 2001:4860:4860::8888: icmp_seq=1 ttl=120 time=1.38 ms
64 bytes from 2001:4860:4860::8888: icmp_seq=2 ttl=120 time=1.35 ms
64 bytes from 2001:4860:4860::8888: icmp_seq=3 ttl=120 time=1.36 ms
64 bytes from 2001:4860:4860::8888: icmp_seq=4 ttl=120 time=1.35 ms
CentOS 8.x
In order to configure IPv6 on CentOS 8 you will have to edit the ifcfg-[network interface name] file.
In this case, the network interface is named em1. We will edit ifcfg-em1 which is located in the directory /etc/sysconfig/network-scripts/
In this example, we will use the following IPv6 subnet: 2a00:7c80:0000:0112::/64
Choose any editor you prefer, and open the ifcfg-em1 file.
[root@worldstream ~]# nano /etc/sysconfig/network-scripts/ifcfg-em1
In an /64 IPv6 subnet there are an enormous amount of addresses, we will setup one address as an example. For the correct usage please refer to rfc5952. The IPv6 address we are going to configure is: 2a00:7c80:0000:0112::2
The configuration file will look similar to the below example.
NAME="em1"
DEVICE="em1"
ONBOOT=yes
NETBOOT=yes
UUID="fd12daaa-8565-448a-b92f-2b20fff930d2"
BOOTPROTO=none
IPADDR="192.168.1.2"
NETMASK="255.255.255.0"
GATEWAY="192.168.1.1"
TYPE=Ethernet
DNS1="217.23.0.121"
DNS2="93.190.136.10"
IPV6INIT=yes
IPV6_AUTOCONF=no
IPV6_FAILURE_FATAL=no
IPV6_ADDR_GEN_MODE=stable-privacy
Then add the following lines to the configuration file:
IPV6ADDR="2a00:7c80:0000:0112::2/64"
IPV6_DEFAULTGW="2a00:7c80:0000:0112::1"
The configuration file will now look as follows:
NAME="em1"
DEVICE="em1"
ONBOOT=yes
NETBOOT=yes
UUID="fd12daaa-8565-448a-b92f-2b20fff930d2"
BOOTPROTO=none
IPADDR="192.168.1.2"
NETMASK="255.255.255.0"
GATEWAY="192.168.1.1"
TYPE=Ethernet
DNS1="217.23.0.121"
DNS2="93.190.136.10"
IPV6INIT=yes
IPV6_AUTOCONF=no
IPV6_FAILURE_FATAL=no
IPV6_ADDR_GEN_MODE=stable-privacy
IPV6ADDR="2a00:7c80:0000:0112::2/64"
IPV6_DEFAULTGW="2a00:7c80:0000:0112::1"
Now save and close the file. With the following command you can apply the network changes:
[root@worldstream ~]# ifdown em1 && ifup em1
To check if IPv6 is configured correctly you can do a ping6 request to Google’s DNS.
[root@worldstream ~]# ping6 2001:4860:4860::8888
If the IPv6 address is configured correctly, the output should be similar to the below example.
[root@worldstream ~]# ping6 2001:4860:4860::8888
PING 2001:4860:4860::8888(2001:4860:4860::8888) 56 data bytes
64 bytes from 2001:4860:4860::8888: icmp_seq=1 ttl=120 time=1.42 ms
64 bytes from 2001:4860:4860::8888: icmp_seq=2 ttl=120 time=1.41 ms
64 bytes from 2001:4860:4860::8888: icmp_seq=3 ttl=120 time=1.40 ms
64 bytes from 2001:4860:4860::8888: icmp_seq=4 ttl=120 time=1.41 ms
CentOS 7.x
In order to configure IPv6 on CentOS 7 you will have to edit the ifcfg-[network interface name] file.
In this case, the network interface is named em1. We will edit ifcfg-em1 which is located in the directory /etc/sysconfig/network-scripts/
In this example, we will use the following IPv6 subnet: 2a00:7c80:0000:0112::/64
Choose any editor you prefer, and open the ifcfg-em1 file.
[root@worldstream ~]# nano /etc/sysconfig/network-scripts/ifcfg-em1
In an /64 IPv6 subnet there are an enormous amount of addresses, we will setup one address as an example. For the correct usage please refer to rfc5952. The IPv6 address we are going to configure is: 2a00:7c80:0000:0112::2
The configuration file will look similar to the below example.
# Generated by dracut initrd
NAME="em1"
DEVICE="em1"
ONBOOT=yes
NETBOOT=yes
UUID="b7733f51-46a2-4486-92f4-bc459f1e701f"
IPV6INIT=yes
BOOTPROTO=none
IPADDR="192.168.1.2"
NETMASK="255.255.255.0"
GATEWAY="192.168.1.1"
TYPE=Ethernet
DNS1="217.23.0.121"
DNS2="93.190.136.10"
IPV6INIT=yes
IPV6_AUTOCONF=no
IPV6_FAILURE_FATAL=no
IPV6_ADDR_GEN_MODE=stable-privacy
Add the following lines to the configuration file:
Networking_IPV6="yes"
DHCPV6C="no"
IPV6ADDR=2a00:7c80:0000:0112::2
IPV6_DEFAULTGW=2a00:7c80:0000:0112::1
The network configuration file will look like this:
# Generated by dracut initrd
NAME="em1"
DEVICE="em1"
ONBOOT=yes
NETBOOT=yes
UUID="b7733f51-46a2-4486-92f4-bc459f1e701f"
IPV6INIT=yes
BOOTPROTO=none
IPADDR="192.168.1.2"
NETMASK="255.255.255.0"
GATEWAY="192.168.1.1"
TYPE=Ethernet
DNS1="217.23.0.121"
DNS2="93.190.136.10"
IPV6INIT=yes
IPV6_AUTOCONF=no
IPV6_FAILURE_FATAL=no
IPV6_ADDR_GEN_MODE=stable-privacy
Networking_IPV6="yes"
DHCPV6C="no"
IPV6ADDR="2a00:7c80:0000:0112::2"
IPV6_DEFAULTGW="2a00:7c80:0000:0112::1"
Save the file and close the file. To apply the adjustments we will restart the network service.
[root@worldstream ~]# systemctl restart network
To check if IPv6 is configured correctly you can perform a ping6 request to Google’s DNS.
[root@worldstream ~]# ping6 2001:4860:4860::8888
If the IPv6 address is configured correctly, the output should be similar to the below example.
[root@worldstream ~]# ping6 2001:4860:4860::8888
PING 2001:4860:4860::8888(2001:4860:4860::8888) 56 data bytes
64 bytes from 2001:4860:4860::8888: icmp_seq=1 ttl=120 time=1.42 ms
64 bytes from 2001:4860:4860::8888: icmp_seq=2 ttl=120 time=1.41 ms
64 bytes from 2001:4860:4860::8888: icmp_seq=3 ttl=120 time=1.40 ms
64 bytes from 2001:4860:4860::8888: icmp_seq=4 ttl=120 time=1.41 ms
Debian 10.x/9.x
In order to change the network settings of Debian 10.x, we will need to edit the /etc/network/interfaces file. In this example we will use the following IPv6 subnet: 2a00:7c80:0000:0112::/64. In this example the network interface is named em1.
First open the interfaces file with a text editor of your choosing.
[root@worldstream ~]# nano /etc/network/interfaces
In an /64 IPv6 subnet there are an enormous amount of addresses, we will setup one address as an example. For the correct usage please refer to rfc5952. The IPv6 address we are going to configure is: 2a00:7c80:0000:0112::2. Add the following lines to the bottom of the file:
auto em1
iface em1 inet6 static
address 2a00:7c80:0000:0112::2/64
gateway 2a00:7c80:0000:0112::1
Save the file and close the file. Now we will use the following command to apply the changes to the network configuration.
[root@worldstream ~]# systemctl restart networking
To check if IPv6 is configured correctly you can do a ping6 request to Google’s DNS.
[root@worldstream ~]# ping6 2001:4860:4860::8888
If the IPv6 address is configured correctly, the output should be similar to the below example.
[root@worldstream ~]# ping6 2001:4860:4860::8888
PING 2001:4860:4860::8888(2001:4860:4860::8888) 56 data bytes
64 bytes from 2001:4860:4860::8888: icmp_seq=1 ttl=120 time=1.37 ms
64 bytes from 2001:4860:4860::8888: icmp_seq=2 ttl=120 time=1.55 ms
64 bytes from 2001:4860:4860::8888: icmp_seq=3 ttl=120 time=1.49 ms
64 bytes from 2001:4860:4860::8888: icmp_seq=4 ttl=120 time=1.41 ms
If you are facing any difficulties with setting up an IPv6 address, feel free to send us an email here.
Learn more about our services: worldstream.com