启动停止

  • 获取firewall状态
systemctl status firewalld.service
firewall-cmd --state
  • 开启停止防火墙
开机启动:systemctl enable firewalld.service
启动:systemctl start firewalld.service
停止:systemctl stop firewalld.service
禁止开机启动:systemctl disable firewalld.service

开放端口

firewall-cmd --zone=public --add-port=80/tcp --permanent
  • –zone #作用域
  • –add-port=80/tcp #添加端口,格式为:端口号/协议
  • –permanent #永久生效,没有此参数重启后失效

禁用端口

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

应用修改

firewall-cmd --reload

查看所有开放的端口

firewall-cmd --zone=dmz --list-ports

其它参数说明

1. firewall-cmd --state ##查看防火墙状态,是否是running 2. firewall-cmd --reload ##重新载入配置,比如添加规则之后,需要执行此命令 3. firewall-cmd --get-zones ##列出支持的zone 4. firewall-cmd --get-services ##列出支持的服务,在列表中的服务是放行的 5. firewall-cmd --query-service ftp ##查看ftp服务是否支持,返回yes或者no 6. firewall-cmd --add-service=ftp ##临时开放ftp服务 7. firewall-cmd --add-service=ftp --permanent ##永久开放ftp服务 8. firewall-cmd --remove-service=ftp --permanent ##永久移除ftp服务 9. iptables -L -n ##查看规则,这个命令是和iptables的相同的
 

CentOS 7.0 Firewall防火墙配置的更多相关文章

  1. CentOS 7.0 firewall防火墙关闭firewall作为防火墙,这里改为iptables防火墙

    CentOS 7.0默认使用的是firewall作为防火墙,这里改为iptables防火墙步骤: 1.先检查是否安装了: iptables service iptables status 2.安装ip ...

  2. centos 7.0 firewall 防火墙常用命令

    1.查看防火墙是否在运行  firewall-cmd --state [root@localhost ~]# firewall-cmd --staterunning 2.查看都有哪些端口添加到例外 f ...

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

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

  4. CentOS 7中firewall防火墙详解和配置以及切换为iptables防火墙

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

  5. CentOS 7中firewall防火墙详解和配置以及切换为iptables防火墙--转载

    最近在linux(这里用到的是Centos7的64位版本)安装nginx时,在开放80端口时用iptables设置端口 和重启服务发现提示未找到文件,在网络上收集查找后发现在Centos7中iptab ...

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

    centos 7中防火墙是一个非常的强大的功能了,但对于centos 7中在防火墙中进行了升级了,下面我们一起来详细的看看关于centos 7中防火墙使用方法.   FirewallD 提供了支持网络 ...

  7. Centos 7 关闭firewall防火墙启用iptables防火墙

    一.关闭firewall防火墙 1.停止firewall systemctl stop firewalld.service 2.禁止firewall开机启动 systemctl disable fir ...

  8. CentOS 7.0如何安装配置iptables和seLinux以及firewalld

    一.配置防火墙,开启80端口.3306端口 CentOS .0默认使用的是firewall作为防火墙,这里改为iptables防火墙. .关闭firewall: systemctl stop fire ...

  9. 在 CentOS 7.0 上安装配置 Ceph 存储

    来自: https://linux.cn/article-6624-1.html Ceph 是一个将数据存储在单一分布式计算机集群上的开源软件平台.当你计划构建一个云时,你首先需要决定如何实现你的存储 ...

随机推荐

  1. generic_netlink 用法

    参考资料: https://wiki.linuxfoundation.org/networking/generic_netlink_howto generic_netlink 框架 +-------- ...

  2. maven3 学习

    主要参考博文:http://www.cnblogs.com/yjmyzz/p/3495762.html 修正: 1.下载maven 3.1.1 先到官网http://maven.apache.org/ ...

  3. [Hbase]Hbase知识大全

    HBase简介 是一个构建在HDFS上的分布式列存储系统:HBase是基于Google BigTable模型开发的,典型的key/value系统:HBase是Apache Hadoop生态系统中的重要 ...

  4. java链表实现

    import java.util.Scanner; class DATA2 { String key; // 结点的关键字 String name; int age; } class CLType / ...

  5. windows中执行celery beat任务

    由于最新的celery4.2不支持windows系统,因此按照网上的建议安装了3.1.25版.按照官网的说明使用 app.conf.beat_schedule = { 'add-every-30-se ...

  6. mybatis学习七 typeAliases 别名

    1. mybatis中内置的一些别名,例如Map,List,int 等常用类型 2.手动为某个类设置别名 在mybatis的全局配置文件中加如下代码 <typeAliases> <t ...

  7. 网上流行的linux内核漫画

  8. ThinkPHP3.2 伪静态配置

    前台伪静态且隐藏入口文件 就把“.htaccess文件” 放到指定文件夹下面 如图home做伪静态并隐藏入口文件: Apache为例,需要在入口文件的同级添加.htaccess文件 如果用的phpst ...

  9. c#多线程编程实战(原书第二版)文摘

    Thread t = new Thread(PrintNumbersWithDelay); t.Start(); t.Join(); 但我们在主程序中调用了t.Join方法,该方法允许我们等待直到线程 ...

  10. IntelliJ IDEA 2017版 Spring5 的RunnableFactoryBean配置

    1.新建RunnableFactoryBean package com.spring4.pojo; import org.springframework.beans.factory.FactoryBe ...