转 http://blog.csdn.net/jamesge2010/article/details/52449678
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 --zone=public --add-port=80/tcp --permanent    (--permanent永久生效,没有此参数重启后失效)
重新载入
firewall-cmd --reload
查看
80/tcp
删除
firewall-cmd --zone= public --remove-port=80/tcp --permanent

centos7 firewalld使用的更多相关文章

  1. CentOS7 firewalld防火墙 启动 关闭 禁用 添加删除规则等 常用命令

    CentOS7 firewalld防火墙 常用命令1.firewalld的基本使用启动: systemctl start firewalld关闭: systemctl stop firewalld查看 ...

  2. centos7 firewalld

    1.firewalld简介 firewalld是centos7的一大特性,最大的好处有两个: 1.支持动态更新,不用重启服务: 2.加入了防火墙的"zone"概念   firewa ...

  3. CentOS7 firewalld 打开关闭端口

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

  4. Centos7 firewalld 基本使用

    Centos7 的防火墙 firewalld比较常见 简单介绍使用 详细介绍链接推荐:   https://blog.csdn.net/buster_zr/article/details/806049 ...

  5. centos7 Firewalld操作集合

    =============================================== 2019/4/15_第1次修改                       ccb_warlock == ...

  6. centos7 firewalld基本使用

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

  7. CentOS7 firewalld防火墙规则

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

  8. CentOS7,Firewalld防火墙使用方法

    查看防火墙状态 systemctl status firewalld.service 启动firewall systemctl stop firewalld.service 停止firewall sy ...

  9. centos7 firewalld 开放端口

    开通80端口 firewall-cmd --zone=public --add-port=80/tcp --permanent --zone #作用域 --add-port=80/tcp #添加端口, ...

随机推荐

  1. ABAP 内表

    定义内表 1. 先声明表结构, 再根据表结构定义内表.   TYPES: BEGIN OF w_itab, a(10), b(10), END OF w_itab. DATA: itab1 type ...

  2. PAT天梯赛 L2-019. 悄悄关注 【STL】

    题目链接 https://www.patest.cn/contests/gplt/L2-019 思路 将已关注的人 用 MAP存起来 然后将点赞的用户中 没有关注的 用 VECTOR 存下来 并且求出 ...

  3. Python 不可变对象

    str是不变对象,而list是可变对象. 对于可变对象,比如list,对list进行操作,list内部的内容是会变化的,比如: >>> a = ['c', 'b', 'a'] > ...

  4. RTMP & HLS

    一,直播云架构 2. RTMP 协议 RTMP(Real Time Messaging Protocol)是Adobe Systems公司为Flash播放器和服务器之间音频.视频和数据传输开发的开放协 ...

  5. LeetCode:二叉树的前、中、后序遍历

    描述: ------------------------------------------------------- 前序遍历: Given a binary tree, return the pr ...

  6. 单链表(C++实现)

    单链表的结构有多种 这里介绍的链表有头结点.有尾节点并且尾节点指向头结点 单链表的每个结点的地址存放在其直接前驱结点的指针域中.其中第一个结点没有前驱结点,因此需要一个头指针指向第一个节点,便于我们对 ...

  7. linux bash缓存

    http://www.xuebuyuan.com/296675.html 在已经运行的系统中更改了某些以前存在于PATH环境变量所指明的目录中的程序的存放目录后可能出现No such file or ...

  8. tp导出excel

    //数据导出 protected function dao($db,$where,$join,$field){ $data = M($db)->join($join)->where($wh ...

  9. Ogre的Singleton实现-模版实现,便于重用-(详细分析)以及笔者的改进

    转自:http://www.cppblog.com/sandy/archive/2005/11/30/1436.html ;Root g_root;//must declare once only / ...

  10. HttpContext.Current为NULL

    总结:HttpContext.Current是基于System.Runtime.Remoting.Messaging.CallContext这个类,子线程和异步线程都无法访问到主线程在CallCont ...