C/C++教程

Centos7启动防火墙时Failed to start firewall.service: Unit not found.

本文主要是介绍Centos7启动防火墙时Failed to start firewall.service: Unit not found.,对大家解决编程问题具有一定的参考价值,需要的程序猿们随着小编来一起学习吧!

想在centos下开放端口结果在启动防火墙时出现问题了
启动防火墙时遇到的问题如下:

root@ecs-d5cf-0015 ~]# systemctl start firewall.service
Failed to start firewall.service: Unit not found. 

是因为没有安装firewalld
依次输入下列命令
(使用yum install firewalld命令安装时,中间停顿输入y既可)

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

这篇关于Centos7启动防火墙时Failed to start firewall.service: Unit not found.的文章就介绍到这儿,希望我们推荐的文章对大家有所帮助,也希望大家多多支持为之网!