想在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 //在不改变状态的条件下重新加载防火墙