启动停止

  • 获取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. 服务程序 -st

    Windows 服务由三部分组成:1.一个服务可执行文件:2.一个服务控制程序(SCP):3.服务控制管理器(SCM),负责在 HKLM\SYSTEM\CurrentControlSet\Servic ...

  2. sqli-labs:11-16,post注入

    sqli11: post:uname=xx' order by 2#&passwd=bla&submit=Submit(判定字段为2) 解释下为什么结果不是admin,这是sql执行的 ...

  3. python常用命令

    安装sudo easy_install pip 列出已安装的包pip freeze or pip list 导出requirements.txtpip freeze > <目录>/r ...

  4. asp.net query string 及 form data 遇到的编码问题

    当遇到此问题时,脑海里闪过的第一个解决方案是设置 web.config 的编码.但一想,就某一个页面的需求而导致其他跟着妥协,不是好的解决方案.于是网上搜索答案,下面做个小分享,遗憾的是研究不够深入, ...

  5. [C#.net]Connection Timeout和Command Timeout

    每次对数据库连接时,我们有时候会碰到连接超时或者命令超时,这两个超时是不一样的.以ADO.NET为例,当客户端和服务器端连接时,碰到的超时情况主要有下面几种: 当从连接池获取一个连接时,碰到超时. 当 ...

  6. 2016-2017-2 20155312 实验二《Java面向对象程序设计》实验报告

    知识总结 伪代码 产品代码 Java编程时,程序员对类实现的测试叫单元测试. 测试用例是为某个特殊目标而编制的一组测试输入.执行条件以及预期结果,以便测试某个程序路径或核实是否满足某个特定需求. 先写 ...

  7. 2019.01.02 bzoj3513: [MUTC2013]idiots(fft)

    传送门 fftfftfft经典题. 题意简述:给定nnn个长度分别为aia_iai​的木棒,问随机选择3个木棒能够拼成三角形的概率. 思路:考虑对于木棒构造出生成函数然后可以fftfftfft出两个木 ...

  8. 高性能Java RPC框架Dubbo与zookeeper的使用

    https://blog.csdn.net/qq_38982845/article/details/83795295

  9. (14)Why some people find exercise harder than others

    https://www.ted.com/talks/emily_balcetis_why_some_people_find_exercise_harder_than_others/transcript ...

  10. TCP/IP协议(6):传输层之UDP

    一. UDP用户数据报协议,它是一个无连接的,面向数据报的协议,它不提供可靠性但传输速度比TCP要快. UDP数据报中的“UDP长度”为两个字节,所以我们要发送的UDP数据最多支持65507大约68K ...