Linux服务只在tcp6下开放问题


  1. 查看端口开放情况:netstat -nlt,发现80端口只在tcp6下开放;
  2. 编辑配置文件:vim /etc/sysctl.conf
    net.ipv6.conf.all.disable_ipv6 = 1
    net.ipv6.conf.default.disable_ipv6 = 1
    net.ipv6.conf.lo.disable_ipv6 = 1
    
    立即生效:/sbin/sysctl -p
  3. 重新查看

penzi 2023年9月27日 10:43