CentOS7默认的防火墙不是iptables,而是firewalle.
出现此情况可能是iptables防火墙未安装。
#停止firewalld服务
systemctl stop firewalld
#禁用firewalld服务
systemctl mask firewalld
开启
systemctl unmask firewalld
安装iptables-services:
yum install iptables-services
设置开机启动:
systemctl enable iptables systemctl [stop|start|restart] iptables #or service iptables [stop|start|restart] service iptables save #or /usr/libexec/iptables/iptables.init save
然后
service iptables status
开启: service iptables start
关闭: service iptables stop
原文地址:https://www.cnblogs.com/liugp/p/11399117.html
时间: 2024-10-08 16:30:07