Red Hat / CentOS IPv6 Network Configuration

To configure IPv6 networking on Red Hat or CentOS, follow these steps:

  1. Open the network configuration file for editing:
    sudo vi /etc/sysconfig/network-scripts/ifcfg-<interface-name>

    Replace <interface-name> with the name of the network interface you want to configure. For example, if you want to configure the eth0 interface, the command would be:

    sudo vi /etc/sysconfig/network-scripts/ifcfg-eth0
  2. Add the following lines to the file:
    IPV6INIT=yes
    IPV6_AUTOCONF=yes

    These lines enable IPv6 and enable automatic configuration of the IPv6 address.

  3. If you want to use a static IPv6 address, add the following line to the file:
    IPV6ADDR=<ipv6-address>/<prefix-length>

    Replace <ipv6-address> with the IPv6 address you want to use, and <prefix-length> with the length of the IPv6 prefix you want to use. For example:

    IPV6ADDR=2001:db8:1234:5678::1/64
  4. If you want to configure a default gateway for IPv6, add the following line to the file:
    IPV6_DEFAULTGW=<ipv6-address>

    Replace <ipv6-address> with the IPv6 address of the default gateway.

  5. Save and close the file.
  6. Restart the network service to apply the changes:
    sudo systemctl restart network

    Alternatively, you can restart the interface directly using the following command:

    sudo ifdown <interface-name>; sudo ifup <interface-name>

    Replace <interface-name> with the name of the network interface you want to restart.

That’s it! Your Red Hat or CentOS system should now be configured for IPv6 networking.

Leave a Comment