Enabling IPv6 for CentOS 5

Open /etc/sysconfig/network file, enter:

# vi /etc/sysconfig/network

Append following line:

NETWORKING_IPV6=yes

Open /etc/sysconfig/network-scripts/ifcfg-eth0 (1st network config file)

# vi /etc/sysconfig/network-scripts/ifcfg-eth0

Append following config directives for IPv6:

IPV6INIT=yes
IPV6ADDR=
IPV6_DEFAULTGW=

Save and close the file. Restart networking:

# service network restart

If the error is occured, see below note.

Verify your configuration by pinging ipv6 enabled site such as ipv6.google.com:

$ ping6 ::1

NOTE:
A Kernel update on one box led to the following system error when trying to enable its IPv6-addresses again.

# /etc/init.d/network restart
Shutting down interface eth0: [ OK ]
Shutting down loopback interface: [ OK ]
FATAL: Module off not found.
CRITICAL : [ipv6_test] Kernel is not compiled with IPv6 support
Bringing up loopback interface: [ OK ]
Bringing up interface eth0: FATAL: Module off not found.
CRITICAL : [ipv6_test] Kernel is not compiled with IPv6 support
[ OK ]
FATAL: Module off not found.
CRITICAL : [ipv6_test] Kernel is not compiled with IPv6 support

Which was odd, since its IPv6 addresses worked just fine before the reboot. Chances are, a change in /etc/modprobe.conf disabled IPv6. Here's what may be in there.

# cat /etc/modprobe.conf

Find it:

alias net-pf-10 off
alias ipv6 off
options ipv6 disable=1

If you comment out those last 3 lines (that effectively disable IPv6) and reboot your box, you should have IPv6 connectivity again. Simply place a #-sign in front of them will suffice.

Loading