1、firewalld的基本使用
启动: systemctl start firewalld
关闭: systemctl stop firewalld
查看状态: systemctl status firewalld 
开机禁用  : systemctl disable firewalld
开机启用  : systemctl enable 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 --zone=public --add-port=80/tcp --permanent    (--permanent永久生效,没有此参数重启后失效)
重新载入
firewall-cmd --reload
查看
firewall-cmd --zone= public --query-port=80/tcp
删除
firewall-cmd --zone= public --remove-port=80/tcp --permanent
 
 

# service firewalld start;  或者 #systemctl start firewalld.service;#开启防火墙

# service firewalld stop;  或者 #systemctl stop firewalld.service;#关闭防火墙

# service firewalld restart;  或者 #systemctl restart firewalld.service;  #重启防火墙

# systemctl disable firewalld.service#禁止防火墙开启自启

# systemctl enable firewalld#设置防火墙开机启动

#yum remove firewalld#卸载firewall

centos7 防火墙的更多相关文章

  1. Centos7防火墙快速开放端口配置方法

    ▲这篇文章主要为大家详细介绍了Centos7防火墙开放端口的快速方法,感兴趣的小伙伴们可以参考一下! Firewalld服务是红帽RHEL7系统中默认的防火墙管理工具,特点是拥有运行时配置与永久配置选 ...

  2. CentOS7 防火墙(firewall)的操作命令

    CentOS7 防火墙(firewall)的操作命令 安装:yum install firewalld 1.firewalld的基本使用 启动: systemctl start firewalld 查 ...

  3. [转帖]Centos7防火墙配置rich-rule实现IP端口限制访问

    Centos7防火墙配置rich-rule实现IP端口限制访问 2019-02-18 18:05:35 sunny05296 阅读数 2143  收藏 更多 分类专栏: Linux   版权声明:本文 ...

  4. (三) Docker 常用操作与CentOS7 防火墙命令

    参考并感谢 Docker 常用命令 https://docs.docker.com/engine/reference/commandline/docker/ Docker 登录docker账户 doc ...

  5. CentOS7 防火墙设置

    CentOS7 防火墙命令 最近在公司服务器上安装了oracle12c数据库,在用数据库客户端连接的时候,连接不了.最后查找资料的原因是因为oracle的服务端口未开放. 首先还是还是输入以往的开启某 ...

  6. CentOS7防火墙firewalld 和 CentOS6防火墙iptables的一些配置命令

    CentOS7 防火墙 一.防火墙的开启.关闭.禁用.查看状态命令 (1)启动防火墙:systemctl start firewalld (2)关闭防火墙:systemctl stop firewal ...

  7. centos6和centos7防火墙的关闭

    CentOS6.5查看防火墙的状态: [zh@localhost ~]$service iptable status 显示结果: [zh@localhost ~]$service iptable st ...

  8. Centos7 防火墙简介(一)

    Centos7下的防火墙默认是通过一个守护进程(firewalld)为网络(network) 以及与之相关的连接(connections)和接口(interface)提供一个可信层,同时支持网络空间( ...

  9. CentOS7防火墙

    一.CentOS7依然使用iptables的方法 CentOS7不再使用iptables,而是使用firewalld,若不想使用firewalld,可以停掉firewalld并且安装iptables- ...

  10. centos7防火墙那些事

    转发设置 firewall-cmd --permanent  --add-forward-port=port=80:proto=tcp:toport=8080 firewall-cmd --perma ...

随机推荐

  1. bzoj 3450 期望分数

    自己只能想到O(n^2)的: dp[i][j] 表示 以i结尾,长度为j的o串的概率,然后在每次遇到x的时候算分数. 正解是: dp[i]表示前i个的答案,d[i]表示以i结尾的期望长度. 推的时候它 ...

  2. python中的zip、lambda、map操作

    python 中有几个比较酷炫的操作,比如:zip.lambda.map 一.zip操作 zip字面意思:拉链.这么来记,把几个东西扔到一个包里,拉上拉链,就算打包好了.通俗点讲,就是把第1个参数.与 ...

  3. class-dump 使用

    转:class-dump 使用 class-dump 官网地址:这里 我这里下载的是 class-dump-3.5.dmg 版本的.双击.dmg 文件,将  拉倒 /usr / local / bin ...

  4. 怎样使用ZOL一键安装器下载中关村在线的源安装包

    怎样使用ZOL一键安装器下载中关村在线的源安装包 马根峰               (广东联合电子服务股份有限公司, 广州 510300) 摘要    中关村在线近期開始推出ZOL一键安装器,用户直 ...

  5. anaconda3/lib/libcrypto.so.1.0.0: no version information available (required by wget)

    Solution: sudo ldconfig /lib/x86_64-linux-gnu/ #you need to use the libcrypto.so from /lib/x86_64-li ...

  6. Postgres和MySQL创建用户并授予db权限

    Postgresql和MySQL还是有很多不同的.就比如授权来说.当下有个业务场景,我们的报表数据库需要根据业务划分不同的db,然后创建对应的user. 如果是MySQL, 可以这样做 mysql&g ...

  7. SpringMVC项目配置欢迎页面为index.html

    一.问题 在web.xml中添加如下配置无效 <welcome-file-list> <welcome-file>index.html</welcome-file> ...

  8. MATLAB 统计数据并画出统计直方图

    统计FilmTrust(0.5-4.0分).CiaoDVD(1-5分).MovieLens(1-5分) 等 rating 数据集分值的分布:  以 统计FilmTrust(0.5-4.0分) 为例: ...

  9. CSS3 选择器 基本选择器介绍

    CSS是一种用于屏幕上渲染html,xml等一种语言,CSS主要是在相应的元素中应用样式,来渲染相对应用的元素,那么这样我们选择相应的元素就很重要了,如何选择对应的元素,此时就需要我们所说的选择器.选 ...

  10. loadrunner 关联匹配多个值

    loadrunner 关联获取从服务器返回相关值,如果需要把所有匹配的值都获取并且把这些值打印出来,怎么做呢? 1.首先要把把所有的匹配值都保存起来,需要在关联函数里面多传递一个参数:"Or ...