Centos7关闭防火墙时遇到的错误Failed to start firewalld.service: Unit not found. Unit firewalld.service could no

Centos7关闭防火墙

今天在centos上想要关闭防火墙,查了一些博客,执行命令

systemctl status firewalld.service

时报错Unit firewalld.service could not be found.
然后查了很多资料都说执行下面这个就解决了

systemctl unmask firewalld.service

然而又报错了
Failed to start firewalld.service: Unit not found.
太头疼了,百度千篇一律的答案始终无法解决,
最后终于找到问题

其实就是要排除你们是否安装了这个firewalld

yum install firewalld
systemctl unmask firewalld
systemctl enable firewalld
systemctl start firewalld

依次执行以上命令后发现终于ok了

其他命令

systemctl start firewalld.service   //开启防火墙
systemctl stop firewalld.service   //关闭防火墙
systemctl enable firewalld.service  //设置开机自动启动
systemctl disable firewalld.service   //设置关闭开机制动启动
firewall-cmd --reload  //在不改变状态的条件下重新加载防火墙

终于解决了,世界安静了!

你可能感兴趣的:(centos7)