1 进入 vim /etc/sysctl.conf

后面添加

net.ipv6.conf.all.disable_ipv6 = 1

net.ipv6.conf.default.disable_ipv6 = 1

执行生效:

sysctl -p