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:
/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
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.
Save the configuration file and exit the text editor.
Restart the network service by running the following command:
systemctl restart network
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.