1、firewalld的基本使用
  启动: systemctl start firewalld
  关闭: systemctl stop firewalld
  查看状态: systemctl status firewalld 
  开机禁用  : systemctl disable firewalld
  开机启用  : systemctl enable 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
4、打开一个端口
  添加
  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
 
  查看监听的端口
  netstat -lnpt (PS:centos7默认没有 netstat 命令,需要安装 net-tools 工具,yum install -y net-tools)
  

  检查端口被哪个进程占用

  netstat -lnpt |grep 5672

  

  查看进程的详细信息

  ps 6832

  

  
 

Centos7 中打开和关闭防火墙及端口的更多相关文章

  1. CentOS7使用firewalld打开关闭防火墙与端口(转载)

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

  2. 关于学习CentOS7使用firewalld打开关闭防火墙和端口

    1.firewalld简介 firewalld是centos7的一大特点,主要有两个优点:一是支持动态更新,不需要重启服务:二就是加入了防火墙的“zone”概念. firewalld有图形界面和工具界 ...

  3. CentOS7使用firewalld打开关闭防火墙与端口(转)

    CentOS7使用firewalld打开关闭防火墙与端口       1.firewalld的基本使用 启动: systemctl start firewalld 关闭: systemctl stop ...

  4. CentOS7打开、关闭防火墙。

    CentOS7 以上机器一些命令和低版本CentOS是有些差异的,本文只针对CentOS7 以上版本. CentOS7使用firewalld打开关闭防火墙与端口1.firewalld的基本使用启动: ...

  5. centos7怎么查看、打开和关闭防火墙

    使用centos7会发现,用centos6以前的方式查看.打开和关闭防火墙都无效了.这是因为centos7的防火墙改用firewalld,而不再使用iptables了 查看centos7的防火墙的状态 ...

  6. CentOS7使用httpd apache 和firewalld打开关闭防火墙与端口

    Centos7 使用systemctl 工具操作命令 systemctl 是Centos7的服务管理工具中的主要工具 ,它融合之前service和chkconfig的功能于一体 一.httpd的设置 ...

  7. 转 CentOS7使用firewalld打开关闭防火墙与端口

    http://blog.csdn.net/huxu981598436/article/details/54864260 开启端口命令 输入firewall-cmd --query-port=6379/ ...

  8. centos7 中如何查看、打开、关闭防火墙。

    首先是看centos7的防火墙的状态,查看的命令为: sudo systemctl status firewalld. 查看后,看到active(running)就意味着防火墙打开了, 如果想关闭防火 ...

  9. centos7 开放/关闭防火墙和端口

    --------------------------------------------------------------防火墙----------------------------------- ...

随机推荐

  1. p标签内不能嵌套块级标签

    今天突然发现一个问题,那就是p标签内不能嵌套块级标签 例如: <p><p></p></p> 会被浏览器解析成 我又把 div 嵌套在里面,发现还是这样 ...

  2. 微信小程序最新授权方法,getUserInfo

    20180511微信小程序正式关闭原先getUserInfo的逻辑 不再允许自动弹出授权框. 方法一: index.wxml(准备一个用于给用户授权的页面,我这里直接用了一个全屏按钮) <vie ...

  3. js移动端滑倒顶部加载历史消息解决方案!

    最近做了一个语音直播聊天的项目,有一个功能是当没有直播时,进入房间可以查看历史消息,滑动到顶部加载之前的历史消息,我用jquery scroll事件,来判断是否滚动到顶部,问题来了: 首先触发请求事件 ...

  4. 操作系统-schedule函数

    1. Linux 0.11的调度函数schedule() 也就是找到了counter最大的进程,然后就跳出去执行switch_to,对应上面的优先级算法,而counter本身也是时间片,也作了轮转调度 ...

  5. xadmin theme

    我在user的adminx中设置了为True之后,我的主题还是加载不出来,具体没找到原因,网上也没有找到相应的资料,不过通过尝试,可以根据需要,添加自己需要的主题,操作如下: 1.找到xadmin文件 ...

  6. 开发RTSP 直播软件 H264 AAC 编码

    上一篇对摄像头预览,拍照做了大概的介绍,现在已经可以拿到视频帧了,在加上 RTSP 实现,就是直播的雏形,当然还要加上一些 WEB 管理和手机平台的支援,就是一整套直播软件. 介绍一些基础概念:RTP ...

  7. 【10】openlayers 视图view

    创建地图: //View对象代表地图的简单2D视图 //创建view let view = new ol.View({ center:[109,34],//视图的初始中心 maxZoom:18,//最 ...

  8. css中:overflow:hidden清除浮动的原理

    要想彻底清除浮动的影响,适合的属性不是 clear 而是 overflow. 一般使用 overflow:hidden,利用 BFC 的“结界”特性彻底解决浮动对外部或兄弟元素的影响. 1. 前言: ...

  9. LeetCode-矩形重叠

    题目描述: 矩形以列表 [x1, y1, x2, y2] 的形式表示,其中 (x1, y1) 为左下角的坐标,(x2, y2) 是右上角的坐标. 如果相交的面积为正,则称两矩形重叠.需要明确的是,只在 ...

  10. Session的常用方法

    Session的常用方法 session对象主要用于属性操作和会话管理,常用方法如下: 1.public void setAttribute(String name,String value)设定指定 ...