1.CentOS官方的Wiki提供了在7上关闭IPv6的方法。英文如下
Upstream employee Daniel Walsh recommends not disabling the ipv6 module, as that can cause issues with SELinux and other components, but adding the following to /etc/sysctl.conf:
net.ipv6.conf.all.disable_ipv6 = 1 net.ipv6.conf.default.disable_ipv6 = 1
To disable in the running system:
echo 1 > /proc/sys/net/ipv6/conf/all/disable_ipv6 echo 1 > /proc/sys/net/ipv6/conf/default/disable_ipv6
or
sysctl -w net.ipv6.conf.all.disable_ipv6=1 sysctl -w net.ipv6.conf.default.disable_ipv6=1
Additional note #1: If problems with X forwarding are encountered on systems with IPv6 disabled, edit /etc/ssh/sshd_config and make either of the following changes:
参考资料:http://blog.csdn.net/skykingf/article/details/41957147
2.在IPv4下ss同时监听IPv4和IPv6后无法使用
方法:修改config
删去"server":["[::0]"]
如果vps只有ipv4地址的话配置文件里同时监听ipv4和ipv6会出错,只能改成"server":"0.0.0.0"才行