方法一: 编辑文件 /etc/sysctl.conf ,新增以下两行 net.ipv6.conf.all.disable_ipv6 = net.ipv6.conf.default.disable_ipv6 = 如果指定网卡禁用其ipv6,添加如下一行 net.ipv6.conf.ens192.disable_ipv6 = 保存,退出,并执行命令 sysctl -p 以上配置生效. 方法二: 要在运行的系统中禁止ipv6,依次输入下面的命令: ~]# > /proc/sys/net/ipv6/co