Title: Configure IPv6
Course: CIS 208: Linux/UNIX III: Intermediate System Administration, Networking, and Security ~ For IGNITE Review > Section: Learning Modules

Configure IPv6

IPv6 is configured by default on most modern distributions.  We will look at the configuration for Red Hat, Fedora and Centos.  Similar settings are available in other distributions.

- To permanently disable IPv6, run the following commands.

echo "net.ipv6.conf.all.disable_ipv6 = 1 " >> /etc/sysctl.conf
echo "net.ipv6.conf.default.disable_ipv6 = 1 " >> /etc/sysctl.conf
sysctl -p

- To re-enable IPv6, run these commands.

sed -i '/disable_ipv6/d' /etc/sysctl.conf
sysctl -p

- The networking configuration file may need to be updated. Edit /etc/sysconfig/network and select either automatic or manual configuration.

NETWORKING_IPV6=yes
IPV6_AUTOCONF=yes
NETWORKING_IPV6=yes
IPV6_AUTOCONF=no
IPV6_DEFAULTGW=<Server_IPV6_Address>
IPV6_DEFAULTDEV=he-ipv6

- In this example, the /etc/sysconfig/network-scripts/ifcfg-he-ipv6 file is updated for a Hurricane Electric IPv6 tunnel.

DEVICE=he-ipv6
TYPE=sit

IPV6INIT=yes
IPV6TUNNELIPV4=<Server_IPv4_Address>
IPV6TUNNELIPV4LOCAL=<Client_IPv4_Address>
IPV6ADDR=<Client_IPv6_Address>

- When using an IPv6 in IPv4 tunnel, the following updates may also be needed.

echo "IPV6FORWARDING=yes" >> /etc/sysconfig/network-scripts/ifcfg-eth0
echo "IPV6ROUTER=yes" >> /etc/sysconfig/network-scripts/ifcfg-eth0
echo "net.ipv4.ip_forward = 1 " >> /etc/sysctl.conf
echo "net.ipv6.conf.all.forwarding = 1 " >> /etc/sysctl.conf
sysctl -p
service network restart

The examples above are shown to give a sense of what settings may be needed.  Be sure to check the documentation from your distribution and the instructions from your ISP or IPv6 service provider.

In addition, the configuration files for various services may need updating.  Check the configuration files or the documentation for details for each service.  For example, the sshd service uses the "AddressFamily" line in /etc/ssh/sshd_config and postfix uses the "inet_interfaces" line in /etc/postfix/main.cf.