1:查看防火状态

systemctl status firewalld

2:暂时关闭防火墙

systemctl stop firewalld

3:永久关闭防火墙

systemctl disable firewalld

4:重启防火墙

systemctl enable firewalld

5:永久关闭后重启

chkconfig iptables on 

6:启动防火墙

systemctl start firewalld

7、禁止防火墙开机启动

systemctl disable firewalld.service 

开放端口的方法:

方法一:命令行方式

       1. 开放端口命令: /sbin/iptables -I INPUT -p tcp --dport 8080 -j ACCEPT
2.查看端口是否开放:/sbin/iptables -L -n   

方法二:指定IP与端口

    1.firewall-cmd --permanent --add-rich-rule="rule family="ipv4" source address="192.168.142.166" port protocol="tcp" port="5432" accept"      //给指定IP开放指定端口

       2.firewall-cmd --permanent --add-rich-rule="rule family="ipv4"  port protocol="tcp" port="9501" accept"      //开放指定端口

    3.重新载入,使配置生效:systemctl restart firewalld.service

    4.查看配置结果:firewall-cmd --list-all

    5.删除规则:firewall-cmd --permanent --remove-rich-rule="rule family="ipv4" source address="192.168.142.166" port protocol="tcp" port="11300" accept"   

CentOS 操作防火墙的更多相关文章

  1. CentOS 配置防火墙操作实例(启、停、开、闭端口):

    CentOS 配置防火墙操作实例(启.停.开.闭端口): 注:防火墙的基本操作命令: 查询防火墙状态: [root@localhost ~]# service   iptables status< ...

  2. CentOS 配置防火墙操作实例(启、停、开、闭端口)CentOS Linux-FTP/对外开放端口(接口)TomCat相关

    链接地址:http://blog.csdn.net/jemlee2002/article/details/7042991 CentOS 配置防火墙操作实例(启.停.开.闭端口): 注:防火墙的基本操作 ...

  3. CentOS配置防火墙操作实例

    CentOS 配置防火墙操作实例(启.停.开.闭端口): 注:防火墙的基本操作命令: 查询防火墙状态: [root@localhost ~]# service iptables status<回 ...

  4. CentOS 配置防火墙操作实例(启、停、开、闭port)

    CentOS 配置防火墙操作实例(启.停.开.闭port): 注:防火墙的基本操作命令: 查询防火墙状态: [root@localhost ~]# service   iptables status& ...

  5. centos 7 防火墙相关操作

    centos 7 防火墙相关操作 CentOS 7.0默认使用的是firewall作为防火墙,这里改为iptables防火墙. 1.关闭firewall: systemctl stop firewal ...

  6. CentOS下防火墙的基本操作命令

    CentOS 配置防火墙操作实例(启.停.开.闭端口): 注:防火墙的基本操作命令: 查询防火墙状态: [root@localhost ~]# service   iptables status< ...

  7. CentOS Linux防火墙配置及关闭

    CentOS 配置防火墙操作实例(启.停.开.闭端口): 注:防火墙的基本操作命令: 查询防火墙状态: [root@localhost ~]# service   iptables status< ...

  8. CentOS 7防火墙服务FirewallD指南

    CentOS 7防火墙服务FirewallD指南 作者:chszs,未经博主同意不得转载.经许可的转载需注明作者和博客主页:http://blog.csdn.net/chszs 防火墙是一种位于内部网 ...

  9. CentOS中防火墙相关的命令(CentOS7中演示)

    CentOS中防火墙程序主要是firewall和iptables,CentOS7中firewall服务已经默认安装好了,而iptables服务需要自己用yum  install  iptabes-se ...

随机推荐

  1. 【转】postgresql 9.4 在linux环境的安装步骤详解

    本文章来为各位介绍一篇关于postgresql 9.4 在linux环境的安装步骤详解,希望文章能够对各位新手朋友带来帮助的哦. 环境说明系统:centos 6.4 64位软件:postgresql ...

  2. Ogre 1.7.0,VS2005编译全过程傻瓜式教程

    最近下了最新版Ogre 1.7.0,从下载到最后编译运行成功Ogre自带的Sample花了将近一下午时间. 网上有很多编译Ogre的教程,这里整理我看过的教程,加上自己的经验再详细总结一遍. 第一步: ...

  3. Nancy Web框架

    原文 Nancy Web框架 Nancy框架 一.创建第一个Nancy应用 二.探索Nancy的module 1. 模块能够在全局被发现 2. 使用模块为路由创建一个根 三.定义路由 1. 方法 2. ...

  4. Android项目实战(四十四):Zxing二维码切换横屏扫描

    原文:Android项目实战(四十四):Zxing二维码切换横屏扫描 Demo链接 默认是竖屏扫描,但是当我们在清单文件中配置横屏显示的时候: <activity android:name=&q ...

  5. android x86 7.0 32bit调试apk时出现的错误

    detected problems with app native libraries libavcodec.so:text relocationslibavutil.solibswresample. ...

  6. vs2015未能正确加载“ProviderPackage”包。

    原文:vs2015未能正确加载“ProviderPackage”包. 出现以下错误的解决方案 --------------------------- Microsoft Visual Studio - ...

  7. Android零基础入门第59节:AnalogClock、DigitalClock和TextClock时钟组件

    原文:Android零基础入门第59节:AnalogClock.DigitalClock和TextClock时钟组件 在前面一期,我们学习了DatePicker和TimePicker,在实际开发中其不 ...

  8. nginx 简单应用

    从源代码编译 Nginx 把源码解压缩之后,在终端里运行如下命令: $ ./configure $ make $ sudo make install 默认情况下,Nginx 会被安装在 /usr/lo ...

  9. 关于DexOpt: not all deps represented

    最近在做android BSP 4.2的时候遇到一个BUG,编译user 版本的时候,系统刷进手机里面去,无限循环在开机动画,编译userdebug 刷机进去的时候发现正常,于是我先回滚到正常的版本, ...

  10. “流”的5个例子(TStream是抽象类,写到文件里和内存里,都是一样的)

    http://www.cnblogs.com/keyvip/category/270215.html