1、修改disable_ipv6.conf
vi /etc/modprobe.d/disable_ipv6.conf
options ipv6 disable=0
2、修改network配置
vi /etc/sysconfig/network
NETWORKING_IPV6=yes
3、修改网卡配置
vi /etc/sysconfig/network-scripts/ifcfg-eth0
IPV6INIT=yes
IPV6_AUTOCONF=yes
4、修改sysctl.conf
vi /etc/sysctl.conf
net.ipv6.conf.all.disable_ipv6 = 0
net.ipv6.conf.default.disable_ipv6 = 0
net.ipv6.conf.lo.disable_ipv6 = 0
sysctl -p
5、创建系统在启动时自动加载 IPv6 模块的脚本
vi /etc/sysconfig/modules/ipv6.modules
#!/bin/sh
if [ ! -c /proc/net/if_inet6 ] ; then
exec /sbin/insmod /lib/modules/uname -r/kernel/net/ipv6/ipv6.ko
fi
6、加载 IPv6 模块
ifconfig | grep -i inet6
查看ipv6的信息,有看到输出就可以