• Help & contact

    For Dedicated Servers

    This article explains how to add an additional, public IPv6 address on a Dedicated Server where Debian 10 is installed.

    To configure an additional public IPv6 address in Debian 10, 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 information with the following:

      auto lo eth0
      iface lo inet loopback

      allow-hotplug eth0
      iface eth0 inet static
       address MAIN IPv4 ADDRESS/32

      iface eth0 inet dhcp
      iface eth0 inet6 manual
          pre-up sleep 5
          post-up sleep 5; /sbin/ip -family inet6 route add default via fe80::1 dev eth0
          pre-down /sbin/ip -family inet6 route del default via fe80::1 dev eth0    
          up dhclient -6 -nw -v eth0
          down dhclient -6 -r -v eth0

      auto eth0:0     
      iface eth0:0 inet6 static
          accept_ra 0
          address ADDITIONAL IPv6 ADDRESS/64

    Note

    For each additional IPv6 address, you need to add an additional section that contains the information below. To do this, a consecutive number is simply appended to the interface name, starting with 1.

    auto eth0:1     
    iface eth0:1 inet6 static
        accept_ra 0
        address ADDITIONAL IPv6 ADDRESS/64

    Example:

    # The loopback network interface
    auto lo
    iface lo inet loopback

    # The primary network interface
    allow-hotplug eth0
    iface eth0 inet static
     address 82.165.126.185/32

    iface eth0 inet dhcp
    iface eth0 inet6 manual
        pre-up sleep 5
        post-up sleep 5; /sbin/ip -family inet6 route add default via fe80::1 dev eth0
        pre-down /sbin/ip -family inet6 route del default via fe80::1 dev eth0    
        up dhclient -6 -nw -v eth0
        down dhclient -6 -r -v eth0

    auto eth0:0     
    iface eth0:0 inet6 static
        accept_ra 0
        address 2001:8d8:1801:818f::1/64

    auto eth0:1     
    iface eth0:1 inet6 static
        accept_ra 0
        address 2001:8d8:1801:818f::2/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@D364224:~# 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 3c:ec:ef:22:f1:34 brd ff:ff:ff:ff:ff:ff
          inet 82.165.126.185/32 brd 82.165.126.185 scope global eth0
             valid_lft forever preferred_lft forever
          inet6 2001:8d8:1801:818f::2/64 scope global deprecated
             valid_lft forever preferred_lft 0sec
          inet6 2001:8d8:1801:818f::1/64 scope global deprecated
             valid_lft forever preferred_lft 0sec
          inet6 fe80::3eec:efff:fe22:f134/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 3c:ec:ef:22:f1:35 brd ff:ff:ff:ff:ff:ff