CentOS 7 防火墙关闭后 iptables 仍然生效的原因及解决方法
可能是因为 CentOS 7 默认使用的是 firewalld,而不是 iptables。如果您已经关闭了 firewalld,但仍然发现 iptables 在起作用,可以尝试以下操作:
-
使用命令
systemctl disable iptables禁用 iptables 服务。 -
如果您之前使用 iptables 进行了配置,可以使用命令
iptables -F清空 iptables 规则。 -
确认一下您的系统是否启用了 SELinux。如果启用了,可能会影响 iptables 的运行。可以使用命令
getenforce查看 SELinux 的状态,如果状态为 Enforcing,则可以尝试禁用 SELinux。 -
最后,建议您使用
netstat -tulnp命令查看当前哪些进程在监听网络端口,以确定 iptables 是否真的在起作用。
原文地址: https://www.cveoy.top/t/topic/oizd 著作权归作者所有。请勿转载和采集!