一、 因为阿里云的公开CentOS 镜像去掉 IPV6 支持,所以系统内核是不加载IPV6驱动模块,故需要首先添加IPV6驱动模块:
进入 /etc/sysconfig/modules,然后创建一个脚本,命名为ipv6.modules(ipv6名字可以改但后缀名不能变),然后编辑其内容如下:
#!/bin/sh
if [ ! -c /proc/net/if_inet6 ] ; then
exec /sbin/insmod /lib/modules/`uname -r`/kernel/net/ipv6/ipv6.ko
fi
注意:保存并修改文件属性为可执行文件:chmod +x ipv6.modules:
重启服务器,使用lsmod查看是否加载了ipv6的模块
二、 开启IPV6隧道
1. 修改/etc/sysctl.conf中ipv6的配置,如下
net.ipv6.conf.all.disable_ipv6 = 0
net.ipv6.conf.default.disable_ipv6 = 0
net.ipv6.conf.lo.disable_ipv6 = 0
2. 修改/etc/modprobe.d/disable_ipv6.