安装

1.下载

yum install -y firewalld
yum install -y firewall-config

2.启动

systemctl start firewalld # 启动
systemctl status firewalld #查看firewalld当前状态
systemctl enable firewalld # 开机启动
systemctl stop firewalld # 关闭
systemctl disable firewalld # 取消开机启动

使用

1.查看开放端口命令

firewall-cmd --list-ports
  1. 添加开放端口
firewall-cmd --zone=public --add-port=5000/tcp --permanent  #对外网全部开放
firewall-cmd --zone=public --permanent --add-rich-rule 'rule family=ipv4 source address=192.168.0.1/24 port port=22 protocol=tcp accept' #添加端口开放
firewall-cmd --permanent --remove-rich-rule 'rule family=ipv4 source address=192.168.0.1/2 port port=5000 protocol=tcp accept' #删除端口开放

Centos7安装防火墙firewall的更多相关文章

  1. Centos7 配置防火墙 firewall

    一.firewall 1.从CentOS7开始,默认使用firewall来配置防火墙,没有安装iptables(旧版默认安装). 2.firewall的配置文件是以xml的格式,存储在 /usr/li ...

  2. centos7 tengine2.1.2 编译安装 防火墙设置

    安装 pcre 和 openssl yum -y install pcre pcre-devel yum -y install openssl openssl-devel wget http://te ...

  3. Centos7启动防火墙时报错Failed to start IPv4 firewall with iptables

    今天在虚拟机的Linux系统(centos7)里安装Redis,准备学习一下布隆过滤器呢,安装完后使用Windows本机访问不了虚拟机里的Redis,telnet不通能够ping通.于是就去看防火墙, ...

  4. CentOS7中关闭firewall,并使用iptables管理防火墙

    背景描述 在使用Docker时,启用centos7默认的firewall,启动端口映射时,防火墙规则不生效.docker默认使用了iptables防火墙机制.所以需要关闭firewall使用iptab ...

  5. Centos7 安装Nginx 防火墙开放80端口给外网访问

    Centos7的防火墙改成了firewall,不再叫iptables,开放端口的方法如下: firewall-cmd --zone=public --add-port=80/tcp --permane ...

  6. centos7安装后的防火墙问题

    centos7 默认使用firewall作为防火墙 停止并关闭开机自启动: systemctl stop firewalld.service #停止firewall systemctl disable ...

  7. centos7防火墙--firewall

    centos7的防火墙变成firewall了 systemctl start firewalld.service#启动firewallsystemctl stop firewalld.service# ...

  8. CentOS7 下使用 Firewall防火墙系统封禁允许IP和端口的访问 端口转发 IP转发方法

    CENTOS7的防火墙系统默认已经从iptable改成了firewall,使用方法也有所不同,下面是详细介绍 一.管理端口 列出 dmz 级别的被允许的进入端口 # firewall-cmd --zo ...

  9. CentOS7 安装Mono及Jexus

    CentOS7安装Mono及Juxes 1 安装Mono 1.1 安装yum-utils 因为安装要用到yum-config-manager,默认是没有安装的,所以要先安装yum-utils包.命令如 ...

随机推荐

  1. 本地git工作流

    一:add后的回退代码 1.在原有已经的基础上,又新增加了一个小需求 经过修改,添加到暂存区. 这个时候,会存在modified文件: 2.然后,又说需求不需要存在了 可以进行丢弃 在reset后,需 ...

  2. PHP用curl抓取网站数据,仿造IP、伪造来源等,防屏蔽解决方案教程

    1.伪造客户端IP地址,伪造访问referer:(一般情况下这就可以访问到数据了) curl_setopt($curl, CURLOPT_HTTPHEADER, ['X-FORWARDED-FOR:1 ...

  3. vagrant报错处理

    vagrant up报错 Warning: Authentication failure. Retrying...解决方案 http://www.cnblogs.com/zqifa/p/vagrant ...

  4. 【C/C++开发】C++编译指令#pragma pack的配对使用

    C++编译指令#pragma pack的配对使用 #pragma pack可以用来指定C++数据结构的成员变量的内存对齐数值(可选值为1,2,4,8,16). 本文主要是强调在你的头文件中使用pack ...

  5. 【神经网络与深度学习】Win10+VS2015 caffe环境搭建(极其详细)

    caffe是好用,可是配置其环境实在是太痛苦了,依赖的库很多不说,在VS上编译还各种报错,你能想象那种被一百多个红色提示所笼罩的恐惧.  且网上很多教程是VS2013环境下编译的,问人很多也说让我把1 ...

  6. 【神经网络与深度学习】【计算机视觉】SPPNet-引入空间金字塔池化改进RCNN

    转自: https://zhuanlan.zhihu.com/p/24774302?refer=xiaoleimlnote 继续总结一下RCNN系列.上篇RCNN- 将CNN引入目标检测的开山之作 介 ...

  7. POJ 2106 Boolean Expressions

    总时间限制: 1000ms  内存限制: 65536kB 描述 The objective of the program you are going to produce is to evaluate ...

  8. HTTP协议:从原理到流程|乐字节

    这次给大家带来的是HTTP协议:从原理到流程的详解 一.HTTP 协议 HTTP 协议(Hypertext Transfer Protocol, 超文本传输协议),是一个客户端请求和回应的 标准协议, ...

  9. 用vue实现列表分页和按钮操作

    为中华之崛起而读书 <!DOCTYPE html> <html> <head> <meta charset="utf-8"> < ...

  10. python爬虫scrapy(一)

    一,准备scrapy依赖组件环境,按照以下顺序安装 .wheel pip install wheel .lxml http:.PyOpenssl https://pypi.python.org/pyp ...