For Dedicated Servers

This article explains how to add an additional, public IPv6 address on a Dedicated Server where Ubuntu 18.04 or Debian 9 are installed.

To configure an additional public IPv6 address in Ubuntu 18.04 or Debian 9, please proceed as follows:

Requirements
  • In the Cloud Panel, you have assigned an additional public IPv6 address to your server.

  • You have logged on to the server as an administrator.

  • Check which network interface is in use and enter the following command:

    [root@localhost ~]# ip addr

  • Open the file /etc/network/interfaces with the editor vi.

    [root@localhost ~]# vi /etc/network/interfaces

Notes
  • The vi Editor has a command mode and an insert mode. To switch to input mode, press [i] on your keyboard. You can now insert the required content or make the required changes. Press the [ESC] key on your keyboard to exit the input mode.

  • To exit vi and save the file, type the command :wq, then press Enter.

  • Replace the entries with the following information:

    auto lo eth0
    iface lo inet loopback

    allow-hotplug eth0
    iface eth0 inet static
     address MAIN IPv4 ADDRESS/32
    netmask 255.255.255.255
    gateway 10.255.255.1

    iface eth0 inet6 manual
    iface eth0 inet6 static
        address MAIN IPv6 ADDRESS
        netmask 64

    iface eth0 inet6 static
        address ADDITIONAL IPv6 ADDRESS
        netmask 64

Note

For each additional IPv6 address, you need to add an additional section that contains the information below:

iface eth0 inet6 static
    address ADDITIONAL IPv6 ADDRESS
    netmask 64

Example:

auto lo eth0
iface lo inet loopback

allow-hotplug eth0
iface eth0 inet static
 address 217.160.213.17/32
netmask 255.255.255.255
gateway 10.255.255.1

iface eth0 inet6 manual
iface eth0 inet6 static
    address 2001:8d8:1800:419::1
    netmask 64

iface eth0 inet6 static
    address 2001:8d8:1800:419::2
    netmask 64

  • Save the file.

  • Restart your server.

  • To check if the additional public IPv6 address has been added, type the following command:

    [root@localhost ~]# ip addr


    The additional public IPv6 address will now be displayed. Example:

    root@3BB37B1:~# ip addr
    1: lo: <LOOPBACK,UP,LOWER_UP> mtu 65536 qdisc noqueue state UNKNOWN group default qlen 1000
        link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00
        inet 127.0.0.1/8 scope host lo
           valid_lft forever preferred_lft forever
        inet6 ::1/128 scope host
           valid_lft forever preferred_lft forever
    2: eth0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc mq state UP group default qlen 1000
        link/ether ac:1f:6b:9a:76:52 brd ff:ff:ff:ff:ff:ff
        inet 217.160.213.17/32 brd 217.160.213.17 scope global eth0
           valid_lft forever preferred_lft forever
        inet6 2001:8d8:1800:419::2/64 scope global
           valid_lft forever preferred_lft forever
        inet6 2001:8d8:1800:419::1/64 scope global
           valid_lft forever preferred_lft forever
        inet6 fe80::ae1f:6bff:fe9a:7652/64 scope link
           valid_lft forever preferred_lft forever
    3: eth1: <BROADCAST,MULTICAST> mtu 1500 qdisc noop state DOWN group default qlen 1000
        link/ether ac:1f:6b:9a:76:53 brd ff:ff:ff:ff:f