一. firewalld的基本使用
启动: systemctl start firewalld
查状态:systemctl status firewalld
停止: systemctl disable firewalld
禁用: systemctl stop firewalld
在开机时启用一个服务:systemctl enable firewalld.service
在开机时禁用一个服务:systemctl disable firewalld.service
查看服务是否开机启动:systemctl is-enabled firewalld.service
查看已启动的服务列表:systemctl list-unit-files|grep enabled

>>> 开启端口
firewall-cmd --zone=public --add-port=80/tcp --permanent

命令含义:
--zone #作用域
--add-port=80/tcp #添加端口,格式为:端口/通讯协议
--permanent #永久生效,没有此参数重启后失效
>>> 重启防火墙
firewall-cmd --reload

常用命令介绍
firewall-cmd --state                           ##查看防火墙状态,是否是running
firewall-cmd --reload                          ##重新载入配置,比如添加规则之后,需要执行此命令
firewall-cmd --get-zones                       ##列出支持的zone
firewall-cmd --get-services                    ##列出支持的服务,在列表中的服务是放行的
firewall-cmd --query-service ftp               ##查看ftp服务是否支持,返回yes或者no
firewall-cmd --add-service=ftp                 ##临时开放ftp服务
firewall-cmd --add-service=ftp --permanent     ##永久开放ftp服务
firewall-cmd --remove-service=ftp --permanent  ##永久移除ftp服务
firewall-cmd --add-port=80/tcp --permanent     ##永久添加80端口 
iptables -L -n                                 ##查看规则,这个命令是和iptables的相同的
man firewall-cmd                               ##查看帮助

CentOS7下firewall-cmd防火墙使用的更多相关文章

  1. CentOS7下Firewall防火墙配置用法详解

    官方文档地址: https://access.redhat.com/documentation/en-US/Red_Hat_Enterprise_Linux/7/html/Security_Guide ...

  2. Centos7 使用firewall管理防火墙

    一.Centos7使用firewall的管理防火墙 1.firewalld基本使用 启动:systemctl start firewalld 关闭:systemctl stop firewalld 状 ...

  3. Centos7(Firewall)防火墙开启常见端口命令

    Centos7默认安装了firewalld,如果没有安装的话,则需要YUM命令安装:firewalld真的用不习惯,与之前的iptable防火墙区别太大,但毕竟是未来主流讲究慢慢磨合它的设置规则: 安 ...

  4. Centos7下安装iptables防火墙

    说明:centos7默认使用的firewalld防火墙,由于习惯使用iptables做防火墙,所以在安装好centos7系统后,会将默认的firewall关闭,并另安装iptables进行防火墙规则设 ...

  5. centos7下Firewall使用详解

    安装它,只需 # yum install firewalld如果需要图形界面的话,则再安装# yum install firewall-config 一.介绍 防火墙守护 firewalld 服务引入 ...

  6. CentOS7下Firewall常用命令

    安装它,只需 yum install firewalld 如果需要图形界面的话,则再安装 yum install firewall-config 一.介绍 防火墙守护 firewalld 服务引入了一 ...

  7. CentOS 7通过Firewall开放防火墙端口

    发现在CentOS 7上开放端口用iptables没效果(或者是sodino没找到正确的命令,传说Centos7 下默认的防火墙是 Firewall,替代了之前的 iptables)… 使用firew ...

  8. linux配置防火墙 Centos7下 添加 端口白名单

    最近在阿里云服务器centos7上部署项目 要开启8484端口 , CentOS 7默认使用的是firewall作为防火墙 在firewall下开启端口白名单 1.查看下防火墙的状态:systemct ...

  9. CentOS7下,防火墙设置

    CentOS中防火墙程序主要是firewall和iptables两种. CentOS7中firewall服务已经默认安装好了,而iptables服务需要自己用yum install  iptabes- ...

  10. CentOS7下配置防火墙放过Keepalived

    Keepalived是一个轻量级的HA集群解决方案,但开启防火墙后各节点无法感知其它节点的状态,各自都绑定了虚拟IP.网上很多文章讲要配置防火墙放过tcp/112,在CentOS7下是无效的,正确的做 ...

随机推荐

  1. 关于==和equals的区别和联系,面试这么回答就可以

    长篇大论的话,我这里就不多写了,相信大家入门java 的时候就知道个大概了,这里想表述的是,如果面试官问你<关于==和equals的区别>,该怎么回答完美呢?可以这样说 总结的来说: 1) ...

  2. SAP_B1系统对象说明 SBO SAP Business One

  3. cnpm包管理

    C:\Users\Administrator>npm config set registry http://registry.npm.taobao.org vue 安装 npm install ...

  4. 手机爬虫--appium

    adb 安装:下载android-sdk压缩包,解压后其中有adb.exe,配置环境变量后即可 cmd下'adb'即可启动adb客户端 adb devices –l  查看已连接的模拟器 adb co ...

  5. Linux性能优化实战学习笔记:第二十八讲

    一.案例环境描述 1.环境准备 2CPU,4GB内存 预先安装docker sysstat工具 apt install docker.io sysstat nake git 案例总共由三个容器组成: ...

  6. Oracle 11g的一些常用语句记录

    一.表空间 1.创建临时表空间: create temporary tablespace project_temp tempfile 'D:\Oracle\dataspace\project_temp ...

  7. 【前端知识体系-HTML相关】HTML基础知识强化总结

    1.如何理解HTML? HTML类似于一份word"文档" 描述文档的"结构" 有区块和大纲 2.对WEB标准的理解? Web标准是由一系列标准组合而成.一个网 ...

  8. CentOS 安装libgdi的方法

    1. 安装必须的包 yum install glib2-devel cairo-devel libjpeg-turbo-devel-1.2.90-8.el7.x86_64 libtiff-devel- ...

  9. golang学习笔记----并发

    并发模型 并发目前来看比较主流的就三种: 多线程:每个线程一次处理一个请求,线程越多可并发处理的请求数就越多,但是在高并发下,多线程开销会比较大. 协程:无需抢占式的调度,开销小,可以有效的提高线程的 ...

  10. 使用Ueditor上传图片到图片服务器(一)

    网站的文章,通过运营平台来发布文章(图文消息),上传图片等.百度Ueditor比较成熟就采用了该技术,另外上传的图片是网站系统以及运营平台系统共享的,所以考虑搭建独立的图片服务器,以后也可以提供给公司 ...