Red Hat / CentOS Add IPv6 Network Alias (multiple IPv6 IP to Same NIC)

h‮:sptt‬//www.lautturi.com
Red Hat / CentOS Add IPv6 Network Alias (multiple IPv6 IP to Same NIC)

To add an IPv6 network alias (multiple IPv6 IP addresses) to a Network Interface Card (NIC) on a Red Hat Enterprise Linux (RHEL) or CentOS system, you will need to have root privileges or a user account with sudo access.

Here are the steps to add an IPv6 network alias to a NIC on a RHEL or CentOS system:

  1. Open the network configuration file for the NIC in a text editor. The file is typically located at /etc/sysconfig/network-scripts/ifcfg-<interface>, where <interface> is the name of the NIC (e.g., eth0, ens3, etc.). For example:
sudo nano /etc/sysconfig/network-scripts/ifcfg-eth0
  1. Add the following lines to the configuration file to specify the IPv6 network alias and its properties:
IPV6INIT=yes
IPV6ADDR_SECONDARIES="<ipv6-address>/<prefix-length>"

Replace <ipv6-address> with the IPv6 address that you want to assign to the network alias, and <prefix-length> with the prefix length of the address (e.g., 64 for a typical IPv6 address). You can specify multiple IPv6 addresses separated by spaces.

  1. Save the configuration file and exit the text editor.

  2. Restart the network service by running the following command:

systemctl restart network
  1. Verify that the network alias has been added to the NIC by running the following command:
ip -6 addr show <interface>

Replace <interface> with the name of the NIC. The command should display a list of IPv6 addresses associated with the NIC, including the network alias that you added.

Keep in mind that the steps and commands shown above are specific to RHEL and CentOS systems, and the exact details may vary depending on the version of the operating system and the specific configuration of your system. Consult the documentation and online resources for more information on how to configure IPv6 network aliases and manage network interfaces on RHEL and CentOS systems.

Created Time:2017-10-30 14:27:14  Author:lautturi