1、firewalld的基本使用
启动: systemctl start firewalld
查看状态: systemctl status firewalld 
停止: systemctl disable firewalld
禁用: systemctl stop firewalld
 
2.systemctl是CentOS7的服务管理工具中主要的工具,它融合之前service和chkconfig的功能于一体。

启动一个服务:systemctl start firewalld.service
关闭一个服务:systemctl stop firewalld.service
重启一个服务:systemctl restart firewalld.service
显示一个服务的状态:systemctl status firewalld.service
在开机时启用一个服务:systemctl enable firewalld.service
在开机时禁用一个服务:systemctl disable firewalld.service
查看服务是否开机启动:systemctl is-enabled firewalld.service
查看已启动的服务列表:systemctl list-unit-files|grep enabled
查看启动失败的服务列表:systemctl --failed

3.配置firewalld-cmd

查看版本: firewall-cmd --version
查看帮助: firewall-cmd --help
显示状态: firewall-cmd --state
查看所有打开的端口: firewall-cmd --zone=public --list-ports
更新防火墙规则: firewall-cmd --reload
查看区域信息:  firewall-cmd --get-active-zones
查看指定接口所属区域: firewall-cmd --get-zone-of-interface=eth0
拒绝所有包:firewall-cmd --panic-on
取消拒绝状态: firewall-cmd --panic-off
查看是否拒绝: firewall-cmd --query-panic
 
那怎么开启一个端口呢?
firewall-cmd --permanent --zone=public --add-port=/tcp --permanent (permanent永久生效,没有此参数重启后失效)

重新载入

firewall-cmd --reload

查看已有的设置

firewall-cmd --zone=public --list-ports
查看指定端口:
firewall-cmd --zone=public --query-port=/tcp

删除

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

CentOS7 防火墙规则 (firewalld)的更多相关文章

  1. CentOS7防火墙管理firewalld

    学习apache安装的时候需要打开80端口,由于centos 7版本以后默认使用firewalld后,网上关于iptables的设置方法已经不管用了,想着反正iptable也不太熟悉,索性直接搬官方文 ...

  2. CentOS7防火墙之firewalld

    今天在centos7上装mysql8,装好了之后发现主机的navicat始终连不上centos中的mysql 搜索发现是防火墙的问题,已查看iptables,嗯?没有了这个防火墙,原来centos换防 ...

  3. CentOS7 firewalld防火墙规则

    在CentOS7里有几种防火墙共存:firewalld.iptables.ebtables,默认是使用firewalld来管理netfilter子系统,不过底层调用的命令仍然是iptables等. f ...

  4. CentOS7 防火墙firewalld详细操作

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

  5. Centos7 防火墙 firewalld 实用操作

    一.前言 Centos7以上的发行版都试自带了firewalld防火墙的,firewalld去带了iptables防火墙.其原因是iptables的防火墙策略是交由内核层面的netfilter网络过滤 ...

  6. CentOS7防火墙firewalld使用

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

  7. centos7的防火墙(firewalld)

    Centos7中默认将原来的防火墙iptables升级为了firewalld,firewalld跟iptables比起来至少有两大好处: 1.firewalld可以动态修改单条规则,而不需要像ipta ...

  8. CentOS7防火墙firewalld

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

  9. 5分钟理解Centos7防火墙firewalld

    版权声明:本内容为原创内容,转载请声明出处. 原文地址:http://www.excelib.com/article/287/show firewalld简介 Centos7中默认将原来的防火墙ipt ...

随机推荐

  1. Zookeeper的安装和初步使用

    1. Zookeeper集群角色 Zookeeper集群的角色:  Leader 和  follower  (Observer) zk集群最好配成奇数个节点 只要集群中有半数以上节点存活,集群就能提供 ...

  2. Android kernel LOGO的更换方法

    [从制作logo到LCD显示或者VGA显示logo] 1.制作logo的方法: 首先选择一个自己喜欢的图片,然后通过GIMP软件将该图片保存为.png格式, 变换方式这个就不说了(very easy) ...

  3. 性能优化之AJAX

    明天就放假啦~哈哈.四月份好像还没有输出呢,吓得我赶紧写点东西... Ajax是高性能JavaScript的基础. Ajax,从最基本的层面来说,是一种与服务器通信而无需重载页面的方法.数据可以从服务 ...

  4. 一些CSS/JS小技巧

    CSS部分 1.文本框不可点击 .inputDisabled{ background-color: #eee;cursor: not-allowed;} 2.禁止复制粘贴 onpaste=" ...

  5. windows下用cordova构建android app

    最近用到cordova打包apk,总结了下,写下来给大家分享. 一.前期准备工作: 1.安装node   6.2.0 *64 下载地址:链接:http://pan.baidu.com/s/1eS7Ts ...

  6. 学习Sass之安装篇

    Sass是基于ruby开发的,所以想要用Sass要先搭建ruby环境 1 Mac下安装 2 windows下安装 3 下载koala,只需要下载这个软件,其余什么都不需要你安装

  7. 关于使用ModelSim中编写testbench模板问题

    对于初学者来说写Testbench测试文件还是比较困难的,但Modelsim和quartus ii都提供了模板,下面就如何使用Modelsim提供的模板进行操作. Modelsim提供了很多Testb ...

  8. C#是否该支持“try/catch/else”语法

    以前用过一段时间Python,里面有个try/catch/else语法,我觉得挺好用,这个语法形如下: try: print('try...') r = 10 / int('2') print('re ...

  9. bzoj1798 [Ahoi2009]维护序列

    Description 老师交给小可可一个维护数列的任务,现在小可可希望你来帮他完成. 有长为N的数列,不妨设为a1,a2,…,aN .有如下三种操作形式: (1)把数列中的一段数全部乘一个值; (2 ...

  10. JWebFileTrans(JDownload): 一款可以从网络上下载文件的小程序(二)

    一  前言 本文是上一篇博客JWebFileTrans:一款可以从网络上下载文件的小程序(一)的续集.此篇博客主要在上一篇的基础上加入了断点续传的功能,用户在下载中途停止下载后,下次可以读取断点文件, ...