添加
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

1、firewalld的基本使用

启动: systemctl start firewalld

查看状态: systemctl status firewalld

停止: systemctl disable firewalld

禁用: systemctl stop firewalld

2.systemctl是CentOS7的服务管理工具中主要的工具,它融合之前service和chkconfig的功能于一体。

启动一个服务:systemctl start firewalld.service
关闭一个服务:systemctl stop firewalld.service
重启一个服务:systemctl restart firewalld.service
显示一个服务的状态:systemctl status firewalld.service
在开机时启用一个服务:systemctl enable firewalld.service
在开机时禁用一个服务:systemctl disable firewalld.service
查看服务是否开机启动:systemctl is-enabled firewalld.service
查看已启动的服务列表:systemctl list-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

转载:http://www.centoscn.com/CentOS/config/2017/0507/8765.html

CentOS firewall添加开放端口的更多相关文章

  1. CentOS 7 为firewalld添加开放端口及相关资料

    1.运行.停止.禁用firewalld 启动:# systemctl start  firewalld 查看状态:# systemctl status firewalld 或者 firewall-cm ...

  2. [转] CentOS 7 为firewalld添加开放端口及相关资料

    转自http://www.cnblogs.com/hubing/p/6058932.html 1.运行.停止.禁用firewalld 启动:# systemctl start  firewalld 查 ...

  3. CentOS 7防火墙开放端口快速方法

    这篇文章主要为大家详细介绍了Centos7.1防火墙开放端口的快速方法,具有一定的参考价值,感兴趣的小伙伴们可以参考一下   例如安装Nagios后,要开放5666端口与服务器连接,命令如下: [ro ...

  4. CentOS7为firewalld添加开放端口

    运行.停止.禁用firewalld 启动:# systemctl start  firewalld 查看状态:# systemctl status firewalld 或者 firewall-cmd ...

  5. Centos 7 iptables 开放端口

    MySQL 开放远程连接时, 已经打开了对应端口的安全组发现还是连接不上, 那么就需要 check 一下防火墙端口是否开放. firewall-cmd --zone=public --query-po ...

  6. centOS服务器-firewall防火墙开放端口

    前言 日常开发中,我们常常会因为服务器各种端口未开放出现各种问题,下面我们就来简单了解下服务器上的端口开放!!! 作为一个后台开发,日常接触最多的除了代码就是服务器了: 产品:谁谁, 线上有个功能报错 ...

  7. centos 7 firewall(防火墙)开放端口/删除端口/查看端口

    1.firewall的基本启动/停止/重启命令 复制#centos7启动防火墙 systemctl start firewalld.service #centos7停止防火墙/关闭防火墙 system ...

  8. centos添加开放端口

    Centos 开放 80 端口 firewall-cmd --zone=public --add-port=80/tcp --permanent 重启防火墙 firewall-cmd --reload ...

  9. CentOS下firewalld添加开放端口

    添加 firewall-cmd --zone=public --add-port=/tcp --permanent (--permanent永久生效,没有此参数重启后失效) 重新载入 firewall ...

随机推荐

  1. mysql 插入多条记录,重复值不插入

    只去除主键与唯一索引的字段,字段为null时 是可以重复插入的domo: insert ignore into table_name(email,phone,user_id) values('test ...

  2. 护卫神·云查杀系统V4.0-安全检测部分

    感谢使用护卫神·云查杀系统,该软件专门查杀网页木马,完全免费,欢迎大家使用.    护卫神·云查杀系统 下载地址:http://down.huweishen.com/free/HwsKill.zip ...

  3. 【译】x86程序员手册37-第10章 初始化

    Chapter 10 Initialization 第10章 初始化 After a signal on the RESET pin, certain registers of the 80386 a ...

  4. js 零散知识

    # 同一种类型的事件注册多个事件句柄,后面的不会覆盖前面的事件 # event.which == 13,13代表回车 # parsley.js验证框架 # JSON.stringify, avoid ...

  5. vs code 格式化 美化 html js css 插件 Beautify

    安装 Beautify 插件 然后 F1 输入 Beautify file 回车即可

  6. CAD参数绘制直径标注(网页版)

    主要用到函数说明: _DMxDrawX::DrawDimDiametric 绘制一个直径标注.详细说明如下: 参数 说明 DOUBLE dChordPointX 在被标注的曲线上的第一个点X值 DOU ...

  7. iis如何在dos中注册

    iis如何在dos中注册   2009-09-23 08:13 提问者采纳   cd \cd c:\windows\microsoft.net\framework\v2.0.50727aspnet_r ...

  8. RabbitMQ之六种队列模式

    先学习一下RabbitMQ中的六种队列,只学习前五种,具体的官方文档地址是:http://next.rabbitmq.com/getstarted.html 导入maven依赖: <depend ...

  9. JS判断字符串包含的方法

    本文实例讲述了JS判断字符串包含的方法.分享给大家供大家参考.具体如下: 1. 例子: 1 2 3 4 5 6 7 8 var tempStr = "tempText" ; var ...

  10. eclipse如何导出WAR包

    WAR包是用于将java项目部署在中间件上的,例如部署在Tomcat,Weblogic,WebSphere等等,那么如何使用eclipse导出WAR包呢? 工具/原料 eclipse 方法/步骤   ...