可能是因为 CentOS 7 默认使用的是 firewalld,而不是 iptables。如果您已经关闭了 firewalld,但仍然发现 iptables 在起作用,可以尝试以下操作:

  1. 使用命令 systemctl disable iptables 禁用 iptables 服务。

  2. 如果您之前使用 iptables 进行了配置,可以使用命令 iptables -F 清空 iptables 规则。

  3. 确认一下您的系统是否启用了 SELinux。如果启用了,可能会影响 iptables 的运行。可以使用命令 getenforce 查看 SELinux 的状态,如果状态为 Enforcing,则可以尝试禁用 SELinux。

  4. 最后,建议您使用 netstat -tulnp 命令查看当前哪些进程在监听网络端口,以确定 iptables 是否真的在起作用。

CentOS 7 防火墙关闭后 iptables 仍然生效的原因及解决方法

原文地址: https://www.cveoy.top/t/topic/oizd 著作权归作者所有。请勿转载和采集!

免费AI点我,无需注册和登录