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

  2. systemctl是CentOS7的服务管理工具中主要的工具,它融合之前service和chkconfig的功能于一体。
    启动一个服务:systemctl start firewalld.service
    关闭一个服务:systemctlstop firewalld.service
    重启一个服务:systemctlrestart firewalld.service
    显示一个服务的状态:systemctlstatus firewalld.service
    在开机时启用一个服务:systemctlenable firewalld.service
    在开机时禁用一个服务:systemctldisable firewalld.service
    查看服务是否开机启动:systemctlis-enabled firewalld.service
    查看已启动的服务列表:systemctllist-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

查看firewall是否运行,下面两个命令都可以
systemctl status firewalld.service
firewall-cmd --state

查看当前开了哪些端口
其实一个服务对应一个端口,每个服务对应/usr/lib/firewalld/services下面一个xml文件。
firewall-cmd --list-services

查看还有哪些服务可以打开
firewall-cmd --get-services

查看所有打开的端口:
firewall-cmd --zone=public --list-ports

更新防火墙规则:
firewall-cmd --reload

Centos7之firewall配置命令的更多相关文章

  1. CentOS7 防火墙Firewall常用命令

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

  2. centos7中firewall防火墙命令详解

    为了架设ss在vultr上买了一个日本的vps 用的是centos7的系统 防火墙是 firewall 捣鼓了两天 在这里总结一下. 如果小伙伴也准备在vultr上买vps  在注册是 可以使用这个优 ...

  3. CentOS7下Firewall常用命令

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

  4. Centos7下常用配置命令

    1.禁用ipv6 Step 1: add this rule in /etc/sysctl.conf : net.ipv6.conf.all.disable_ipv6=1 Step 2: add th ...

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

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

  6. RHEL7 CentOS7 的 firewall命令简单介绍

    firewall 服务介绍 firewall 服务是 redhat7 和 centos7 系统默认安装好的防火墙服务,一个信任级别的概念来管理与之相关联的连接与接口.它支持 ipv4 与 ipv6,并 ...

  7. ss_port_change - 一键修改ss配置与Centos7的Firewall策略脚本

    ss_port_change 修改ss配置与Centos7的Firewall策略脚本 注意是否需要修改config路径与ss服务的名 脚本的敏感字用了*代替 项目地址 Github 脚本 #!/bin ...

  8. Centos7中hadoop配置

    Centos7中hadoop配置 1.下载centos7安装教程: http://jingyan.baidu.com/article/a3aad71aa180e7b1fa009676.html (注意 ...

  9. Centos7 防火墙常用配置及说明

    一. Centos7和Centos6 防火墙的区别: 使用的工具不一样了.Centos6 使用的是iptables ,Centos7 使用的是filewall iptables 用于过滤数据包,属于网 ...

随机推荐

  1. Linux起源

    Linux起源 操作系统出现时间线: Unix1970年诞生 ,71年用C语言重写 Apple II 诞生于1976年 window诞生于1985年 Linux诞生于1991年,由大学生Linus T ...

  2. Processing 3!

    Welcome to Processing 3! Dan explains the new features and changes; the links Dan mentions are on th ...

  3. 网络io模型总结

    操作系统基本概念 首先来来说下操作系统,嗯,操作系统是计算机硬件的管理软件,是对计算机硬件的抽象,操作系统将应用程序分为用户态和内核态,例如驱动程序就位于内核态,而我们写的一般程序都是用户态,包括we ...

  4. Day9-Python3基础-多线程、多进程

    1.进程.与线程区别 2.python GIL全局解释器锁 3.线程 语法 join 线程锁之Lock\Rlock\信号量 将线程变为守护进程 Event事件 queue队列 生产者消费者模型 Que ...

  5. GC原理---垃圾收集算法

    垃圾收集算法 Mark-Sweep(标记-清除算法) 标记清除算法分为两个阶段,标记阶段和清除阶段.标记阶段任务是标记出所有需要回收的对象,清除阶段就是清除被标记对象的空间. 优缺点:实现简单,容易产 ...

  6. P4173 残缺的字符串(FFT字符串匹配)

    P4173 残缺的字符串(FFT字符串匹配) P4173 解题思路: 经典套路将模式串翻转,将*设为0,设以目标串的x位置匹配结束的匹配函数为\(P(x)=\sum^{m-1}_{i=0}[A(m-1 ...

  7. RoBERTa模型总结

    RoBERTa模型总结 前言 ​ RoBERTa是在论文<RoBERTa: A Robustly Optimized BERT Pretraining Approach>中被提出的.此方法 ...

  8. C# LINQ查询表达式用法对应Lambda表达式

    C#编程语言非常优美,我个人还是非常赞同的.特别是在学习一段时间C#后发现确实在它的语法和美观度来说确实要比其它编程语言强一些(也可能是由于VS编译器的加持)用起来非常舒服,而且对于C#我觉得他最优美 ...

  9. Docker三剑客之compose

    简介 Compose 项目是 Docker 官方的开源项目,负责实现对 Docker 容器集群的快速编排.从功能上看,跟 OpenStack 中的 Heat 十分类似.其代码目前在 https://g ...

  10. Jenkins | 搭建你第一个Jenkins应用

    搭建你第一个Jenkins应用 1.准备工作 第一次使用 Jenkins,您需要: 机器要求: 256 MB 内存,建议大于 512 MB 10 GB 的硬盘空间(用于 Jenkins 和 Docke ...