首页 » IDC运维 » CentOS7.x防火墙命令firewalld开启端口和关闭端口使用教程详解

CentOS7.x防火墙命令firewalld开启端口和关闭端口使用教程详解

 

CentOS7.x防火墙命令firewalld开启端口和关闭端口使用教程详解

启动防火墙

systemctl start firewalld

关闭防火墙

systemctl disable firewalld

禁用防火墙

systemctl disable firewalld

设置防火墙开机启动

systemctl enable firewalld

查看防火墙状态

systemctl status firewalld 

开启端口(例如开启80)

firewall-cmd --zone=public --add-port=80/tcp --permanent 

删除(关闭)端口(例如80)

firewall-cmd --zone= public --remove-port=80/tcp --permanent

防火墙加载生效(在对端口修改之后一定要重新记载配置生效)

firewall-cmd --reload

查看防火墙开启了哪些端口

firewall-cmd --list-ports

需要知道的是,有些防火墙默认放行的程序端口不会出现。

原文链接:CentOS7.x防火墙命令firewalld开启端口和关闭端口使用教程详解,转载请注明来源!

0