首先是看centos7的防火墙的状态,查看的命令为:

sudo systemctl status firewalld

查看后,看到active(running)就意味着防火墙打开了,

如果想关闭防火墙,命令为:

sudo systemctl stop firewalld

关闭后查看是否关闭成功,看到inactive (dead)就意味着防火墙关闭了。

打开防火墙的命令为:

sudo systemctl start firewalld

前面为临时打开关闭防火墙,reboot 重启电脑后又会恢复成开启的状态,

如果是想重启后防火墙还是处于关闭的状态,就可以使用命令:

sudo systemctl disable firewalld
输入上一步命令后重新启动,在次查看防火墙状态,这时候防火墙就处于关闭状态了。

查看防火墙的状态的命令为:sudo systemctl status firewalld

打开防火墙的方式有两种,一种是打开后重启会恢复回原来的状态,命令为:sudo systemctl start firewalld

另一种是打开后重启不会恢复到原来的状态,命令为:sudo systemctl enable firewalld,这种方式输入命令后要重启系统才会生效。

关闭防火墙的方式也有两种,和打开对应,命令分别为

sudo systemctl stop firewalld

sudo systemctl disable firewalld

centos7 中如何查看、打开、关闭防火墙。的更多相关文章

  1. centos7.4使用filrewalld打开关闭防火墙与端口

    1.firewalld的基本使用启动: systemctl start firewalld关闭: systemctl stop firewalld查看状态: systemctl status fire ...

  2. CentOS7使用firewalld打开关闭防火墙与端口(转载)

    1.firewalld的基本使用 启动: systemctl start firewalld 查看状态: systemctl status firewalld 停止: systemctl disabl ...

  3. 关于学习CentOS7使用firewalld打开关闭防火墙和端口

    1.firewalld简介 firewalld是centos7的一大特点,主要有两个优点:一是支持动态更新,不需要重启服务:二就是加入了防火墙的“zone”概念. firewalld有图形界面和工具界 ...

  4. CentOS7使用httpd apache 和firewalld打开关闭防火墙与端口

    Centos7 使用systemctl 工具操作命令 systemctl 是Centos7的服务管理工具中的主要工具 ,它融合之前service和chkconfig的功能于一体 一.httpd的设置 ...

  5. CentOS7使用firewalld打开关闭防火墙与端口(转)

    CentOS7使用firewalld打开关闭防火墙与端口       1.firewalld的基本使用 启动: systemctl start firewalld 关闭: systemctl stop ...

  6. 转 CentOS7使用firewalld打开关闭防火墙与端口

    http://blog.csdn.net/huxu981598436/article/details/54864260 开启端口命令 输入firewall-cmd --query-port=6379/ ...

  7. 【linux命令】打开关闭防火墙iptables

    防火墙关闭 关闭防火墙(linux) 经过自己的实验,发现在ubuntu中service iptables 无法使用. 同时,在init.d中并没有iptables的程序,iptables程序在/sb ...

  8. CentOS7使用firewalld打开关闭防火墙与端口

    1.firewalld的基本使用 启动: systemctl start firewalld 查看状态: systemctl status firewalld  停止: systemctl disab ...

  9. CentOS7 使用firewalld打开关闭防火墙与端口

    1.firewalld的基本使用 启动: systemctl start firewalld 关闭: systemctl stop firewalld 查看状态: systemctl status f ...

随机推荐

  1. Django + pyecharts 实现数据可视化

    1 创建django项目 :Visualization and  APP :Demo >>django-admin startproject Visualization >>p ...

  2. C# IIS域名绑定

    C#解决IIS域名批量绑定: https://shiyousan.com/post/636022975388168065 C#程序控制IIS 添加站点域名绑定: https://blog.csdn.n ...

  3. python实现一个朴素贝叶斯分类方法

    1.公式 上式中左边D是需要预测的测试数据属性,h是需要预测的类:右边式子分子是属性的条件概率和类别的先验概率,可以从统计训练数据中得到,分母对于所有实例都一样,可以不考虑,所有只需 ,返回最大概率的 ...

  4. [BZOJ2002][洛谷P3203][Hnoi2010]Bounce 弹飞绵羊(LCT维护链长)

    luogu传送门 2002: [Hnoi2010]Bounce 弹飞绵羊 Time Limit: 10 Sec  Memory Limit: 259 MBSubmit: 16082  Solved:  ...

  5. 使用ElementUI创建项目

    从 0 开始搭建 element 项目 第一步,安装 Nodejs/NPM https://nodejs.org/zh-cn/download/ 下载安装即可! 第二步,安装 vue-cli 打开 c ...

  6. centos6 centos7 配置开机启动服务

    centos 6 :使用chkconfig命令即可. 我们以apache服务为例: #chkconfig --add apache 添加nginx服务 #chkconfig apache on 开机自 ...

  7. redis哨兵集群搭建

    下载redis jar包redis-4.0.11.tar.gz放在/data/redis目录下 解压 命令:tar -zxvf redis-4.0.11.tar.gz 解压后如图所示 在/usr/lo ...

  8. 2019-7-29未命名文件 sdfsdfsdf

    2019-7-29未命名文件 sdfsdfsdf 新建模板小书匠 欢迎使用 小书匠(xiaoshujiang)编辑器,您可以通过设置里的修改模板来改变新建文章的内容.

  9. Selenium 2自动化测试实战18(上传文件)

    一.上传文件 上传文件是比较常见的web功能之一,但WebDriver没有提供专门用于上传的方法. 一般web页面的上传功能的操作需要单击“上传”按钮后打开本地的Window窗口,从窗口选择本地文件进 ...

  10. RabbitMQ问题解决

    1.访问http://localhost:15672/#/,输入用户名.密码登录报错500 解决方法:在快捷程序处找到RabbitMQ Service -stop停止服务,然后再点击RabbitMQ ...