CentOS7出现Unit iptables.service could not be found

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
CentOS7出现Unit iptables.service could not be found_第1张图片

开启: service iptables start

关闭: service iptables stop

你可能感兴趣的:(CentOS7出现Unit iptables.service could not be found)