Adding a Public IPv6 Address to a Linux Server (CentOS 7)

To configure an additional public IPv6 address in CentOS 7, proceed as follows:

Prerequisites:

You wrote down the main IPv4 address.

You have assigned an additional IPv6 address to the server.

You have logged in to the server as an administrator.

  1. To add the main IPv6 address, you must insert the following entries in /etc/sysconfig/network-scripts/ifcfg-ens192:
    Networking_IPV6="yes"
    DHCPV6C="no"
    IPV6INIT="yes"
    IPV6_AUTOCONF="no"
    IPV6ADDR=MAIN IPv6 ADDRESS/64
    IPV6_DEFAULTGW=fe80::1%ens192

    Example:

    [root@localhost ~]# vi /etc/sysconfig/network-scripts/ifcfg-ens192
    DHCP_HOSTNAME="localhost.localdomain"
    DEVICE="ens192"
    BOOTPROTO="dhcp"
    Networking_IPV6="yes"
    DHCPV6C="no"
    IPV6INIT="yes"
    IPV6_AUTOCONF="no"
    IPV6ADDR=2001:ba0:2020:bce5:cdb:a034:601e:e952/64
    IPV6_DEFAULTGW=fe80::1%ens192
    NM_CONTROLLED="no"
    ONBOOT="yes"
  2. To add the additional IPv6 address, you must specify in /etc/sysconfig/network-scripts/ifcfg-ens192 the entryIPV6ADDR_SECONDARIES= and the additional IPv6 address. Example:
    [root@localhost ~]# vi /etc/sysconfig/network-scripts/ifcfg-ens192
    DHCP_HOSTNAME="localhost.localdomain"
    DEVICE="ens192"
    BOOTPROTO="dhcp"
    Networking_IPV6="yes"
    DHCPV6C="no"
    IPV6INIT="yes"
    IPV6_AUTOCONF="no"
    IPV6ADDR=2001:ba0:2020:bce5:cdb:a034:601e:e952/64
    IPV6_DEFAULTGW=fe80::1%ens192
    IPV6ADDR_SECONDARIES=2001:ba0:2020:bce5:678f:bcca:b152:a6ae/64
    NM_CONTROLLED="no"
    ONBOOT="yes"
    Note: To configure multiple additional IPv6 addresses, enter them in the IPV6ADDR_SECONDARIES= entry and separate them with a space.
  3. To restart the network, enter the following command:
    [root@localhost /]# /etc/init.d/network restart
  4. To check whether the additional IPv6 address has been assigned to the server, type the following command:
    [root@localhost /]# ifconfig ens192
 
  • 0 Users Found This Useful
Was this answer helpful?

Related Articles

How can I configure a ip range in CentOS7?

You have to use a range file Edit /etc/sysconfig/network-scripts/ifcfg-enp0s3 and make...

How To Install EPEL Repository On CentOS And RHEL 7

How to install EPEL for Centos 7 [root@localhost ~]# cat  /etc/centos-release CentOS Linux...

Common Commands (CentOS 7)

Basic Configuration Query or System Locale...

Install LAMP Stack on CentOS 7

Install LAMP Stack on CentOS 7 One of the most simple and barebones solutions you can have for...

How to set up a monitoring server using Monit on CentOS 7

Monit is an open source monitoring tool. It has various monitoring functions of great value for...