1. 查看ipv6的设置状态,1为关闭,0为开启
cat /proc/sys/net/ipv6/conf/all/disable_ipv6
  1. 编辑文件 /etc/sysctl.conf,设置如下,0为开启,1为关闭
net.ipv6.conf.all.disable_ipv6 = 0
net.ipv6.conf.default.disable_ipv6 = 0
net.ipv6.conf.lo.disable_ipv6 = 0

3.使配置生效

sysctl -p