版權聲明:本文爲博主原創文章,遵循 CC 4.0 by-sa 版權協議,轉載請附上原文出處連接和本聲明。
本文連接:https://blog.csdn.net/wbdxz/article/details/79597020
1.CentOS官方的Wiki提供了在7上關閉IPv6的方法。英文以下ssh
How do I disable IPv6?.net
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:component
net.ipv6.conf.all.disable_ipv6 = 1
net.ipv6.conf.default.disable_ipv6 = 1
To disable in the running system:server
echo 1 > /proc/sys/net/ipv6/conf/all/disable_ipv6
echo 1 > /proc/sys/net/ipv6/conf/default/disable_ipv6
orblog
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:vps
參考資料:http://blog.csdn.net/skykingf/article/details/41957147ip
2.在IPv4下ss同時監聽IPv4和IPv6後沒法使用it
方法:修改configio
刪去"server":["[::0]"]
若是vps只有ipv4地址的話配置文件裏同時監聽ipv4和ipv6會出錯,只能改爲"server":"0.0.0.0"才行
————————————————
版權聲明:本文爲CSDN博主「SeniorZ」的原創文章,遵循CC 4.0 by-sa版權協議,轉載請附上原文出處連接及本聲明。
原文連接:https://blog.csdn.net/wbdxz/article/details/79597020stream