您的位置:首页 > 运维架构 > Linux

【linux】Centos7在55环境下总是监听tcp6/udp6,导致无法使用

2020-01-15 09:43 323 查看

版权声明:本文为博主原创文章,遵循 CC 4.0 by-sa 版权协议,转载请附上原文出处链接和本声明。
本文链接:https://blog.csdn.net/wbdxz/article/details/79597020
1.CentOS官方的Wiki提供了在7上关闭IPv6的方法。英文如下

How do I disable 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"才行
 ———————————————— 
版权声明:本文为CSDN博主「SeniorZ」的原创文章,遵循CC 4.0 by-sa版权协议,转载请附上原文出处链接及本声明。
原文链接:https://blog.csdn.net/wbdxz/article/details/79597020

转载于:https://my.oschina.net/airship/blog/3098478

  • 点赞
  • 收藏
  • 分享
  • 文章举报
chijue3990 发布了0 篇原创文章 · 获赞 0 · 访问量 4433 私信 关注
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: 
相关文章推荐