Centos7 的防火墙 firewalld比较常见

  简单介绍使用

  详细介绍链接推荐:   https://blog.csdn.net/buster_zr/article/details/80604933

            http://blog.51cto.com/13503302/2095633

            https://www.jianshu.com/p/c06890b7739e

firewalld 使用:

  iptables firewalld 都是防火墙程序,并且firewalld内部也是通过iptables实现防火墙配置,但是两个程序不能同时运行

  安装

  如果iptables在运行,先关闭

  systemctl stop iptables    #关闭iptables

  systemctl disable iptables  #禁止iptables 开机启动

  systemctl status firewalld  #查看防火墙firewalld状态

  如果运行,会显示Active: active (running)  

  firewall-cmd --state      #查看防火墙firewalld状态的另一种方式

  no runing 表示没有运行

  yum -y install firewalld    #安装 firewalld

  systemctl enable firewalld  #设置开启启动

  systemctl start firewalld   #启动

  firewall-cmd --list-all   #查看默认区域已有规则  

  firewall-cmd --list-all-zones  #查看所有区域规则 

  添加端口

  firewall-cmd --zone=public --add-port=端口/类型 --permanent # 加上--permanent 表示永久生效

  如果修改了ssh端口,ssh端口修改为5511 那么可以开启5511端口

  firewall-cmd --zone=public --add-port=5511/tcp --permanent  #开启5511端口 tcp类型

  firewall-cmd --reload #重新加载规则,使设置马上生效

   

  配置文件

  两个位置      /usr/lib/firewalld/  /etc/firewalld/

  默认的配置在第一个位置,如果添加自己的规则,建议在第二个文件位置出修改

  添加服务  

  firewall-cmd --zone=pubic --add-service=服务名

  服务很多已经有了配置文件 就是在/usr/lib/firewalld/目录下面  如 http服务 就是 /usr/lib/firewalld/services/http.xml

  所以如若要开启80端口  可以有两种方式

  方式一: firewall-cmd --zone=pubic --add-service=http --permanent  #添加http 服务  配置文件中默认是80端口

  方式二: firewall-cmd --zone=public --add-port=80/tcp  --permanent  #添加 80/tcp 端口 

  firewall-cmd --reload #重载配置

  添加 443 端口https 服务

  firewall-cmd --zone=pubic --add-service=https --permanent

  firewall-cmd --reload        

  

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操作集合

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

  5. centos7 firewalld基本使用

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

  6. centos7 firewalld使用

    转 http://blog.csdn.net/jamesge2010/article/details/52449678 1.firewalld的基本使用 启动: systemctl start fir ...

  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. STM32F1xx寄存器版库

    文件下载链接 https://files.cnblogs.com/files/listenscience/STM32F1xx%28MDK5%292018.10.20.rar

  2. python持久化

    将对象转为二进制字节流(pickle) import pickle my_list = [1,2,3] pickle_file = open('my_list.pkl', 'wb') #注意二进制写入 ...

  3. SDWebImage之UIView+WebCache

    UIView+WebCache是我们能很方便的使用sd_setImageWithURL:系列方法来加载图片的关键类.UIButton(WebCache).MKAnnotationView(WebCac ...

  4. 背水一战 Windows 10 (63) - 控件(WebView): 基础知识, 加载 html, http, https, ms-appx-web:///, embedded resource, ms-appdata:///, ms-local-stream://

    [源码下载] 背水一战 Windows 10 (63) - 控件(WebView): 基础知识, 加载 html, http, https, ms-appx-web:///, embedded res ...

  5. Angular使用总结 --- 通过指令动态添加组件

    之前自己写的公共组件,都是会先引入,需要调起的时候再通过service控制公共组件状态.值.回调函数什么的.但是有一些场景不适合这种方式,还是动态添加组件更加好.通过写过的一个小组件来总结下. 创建组 ...

  6. 使用node.js如何爬取网站数据

    数据库又不会弄,只能扒扒别人的数据了. 搭建环境: (1).创建一个文件夹,进入并初始化一个package.json文件.  npm init -y (2).安装相关依赖:  npm install ...

  7. 使用request爬取拉钩网信息

    通过cookies信息爬取 分析header和cookies 通过subtext粘贴处理header和cookies信息 处理后,方便粘贴到代码中 爬取拉钩信息代码 import requests c ...

  8. [视频]K8软件破解脱壳入门教程

    [视频]K8软件破解脱壳入门教程 链接:https://pan.baidu.com/s/1aV9485MmtRedU6pzyr--Vw 提取码:vbak C:\Users\K8team\Desktop ...

  9. 可能比文档还详细--VueRouter完全指北

    可能比文档还详细--VueRouter完全指北 前言 关于标题,应该算不上是标题党,因为内容真的很多很长很全面.主要是在官网的基础上又详细总结,举例了很多东西.确保所有新人都能理解!所以实际上很多东西 ...

  10. hdu 6086 -- Rikka with String(AC自动机 + 状压DP)

    题目链接 Problem Description As we know, Rikka is poor at math. Yuta is worrying about this situation, s ...