centos7怎么查看防火墙是否运行

admin 阅读:88 2024-03-02

查看方法:1、利用systemctl查看,该命令用于管理系统,语法为“systemctl status firewalld”;2、用firewall查看,可以查看防火墙的默认状态,语法为“firewall-cmd --state”。

centos7怎么查看防火墙是否运行

本文操作环境:centos 7系统、Dell G3电脑。

centos7怎么查看防火墙是否运行

方法一:systemctl status firewalld 

防火墙的开启、关闭、禁用命令

(1)设置开机启用防火墙:systemctl enable firewalld.service

(2)设置开机禁用防火墙:systemctl disable firewalld.service

(3)启动防火墙:systemctl start firewalld

(4)关闭防火墙:systemctl stop firewalld

(5)检查防火墙状态:systemctl status firewalld 

示例如下:

38.png

方法二:firewall-cmd --state

查看默认防火墙状态(关闭后显示notrunning,开启后显示running)

systemctl stop firewalld.service #停止firewall
systemctl disable firewalld.service #禁止firewall开机启动

推荐教程:《centos教程


以上就是【centos7怎么查看防火墙是否运行】的详细内容。

想要了解更多内容,请持续关注码农资源网,一起探索发现编程世界的无限可能!

本站部分资源来源于网络,仅限用于学习和研究目的,请勿用于其他用途。

如有侵权请发送邮件至1943759704@qq.com删除

声明

1、部分文章来源于网络,仅作为参考。
2、如果网站中图片和文字侵犯了您的版权,请联系1943759704@qq.com处理!

搜索