指点成金-最美分享吧

登录

centos7 怎样查看防火墙状态?

佚名 举报

篇首语:本文由小编为大家整理,主要介绍了centos7 怎样查看防火墙状态?相关的知识,希望对你有一定的参考价值。

参考技术A 使用命令iptables
-L查看。
CentOS(Community
Enterprise
Operating
System)是Linux发行版之一,它是来自于Red
Hat
Enterprise
Linux依照开放源代码规定释出的源代码所编译而成。由于出自同样的源代码,因此有些要求高度稳定性的服务器以CentOS替代商业版的Red
Hat Enterprise
Linux使用。两者的不同,在于CentOS并不包含封闭源代码软件。

CentOS7.2防火墙配置

一、查看firewall以及firewall服务的状态。

# 查看firewall服务状态systemctl status firewalld# 查看firewall状态firewall-cmd --state

 

二、开启,关闭,重启firewall服务状态

# 开启service firewalld start# 重启service firewalld restart# 关闭service firewalld stop

 

三、重启防火墙

#修改设置后要重启防火墙firewall-cmd --reload

 

四、查询、开放、关闭端口

# 查询端口是否开放firewall-cmd --query-port=80/tcp# 开放80端口firewall-cmd --permanent --add-port=80/tcp# 移除端口firewall-cmd --permanent --remove-port=80/tcp

# 查看防火墙的开放的端口firewall-cmd --permanent --list-ports# 查看防火墙规则firewall-cmd --list-all

以上是关于centos7 怎样查看防火墙状态?的主要内容,如果未能解决你的问题,请参考以下文章