1.firewalld简介
firewalld是centos7的一大特点,主要有两个优点:一是支持动态更新,不需要重启服务;二就是加入了防火墙的“zone”概念。
firewalld有图形界面和工具界面,firewalld的字符界面管理工具是 firewall-cmd,firewalld默认配置文件有两个:一个是系统配置/usr/lib/firewalld/ ,另一个是用户配置地址/etc/firewalld/ 

2.安装firewalld

使用root登入,然后执行# yum install firewalld firewall-config

3.firewalld的基本使用
启动: systemctl start firewalld
关闭: systemctl stop firewalld
查看状态: systemctl status firewalld 或者 firewall-cmd --state
开机禁用  : systemctl disable firewalld
开机启用  : systemctl enable firewalld
 
3.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

4.配置firewalld-cmd

查看版本:$ firewall-cmd --version

查看帮助:$ firewall-cmd --help
显示状态:$ firewall-cmd --state
查看所有打开的端口:$ firewall-cmd --zone=dmz --list-ports
查看区域信息: $ 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 --reload或者 $ firewall-cmd --complete-reload
5.开启端口
添加端口: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
6.重启和设置开机启动

重启防火墙使配置生效:# systemctl restart firewalld      
设置防火墙开机启动:# systemctl enable firewalld       
以上便是在学习过程中了解到的关于centos7使用firewalld打开关闭防火墙和端口。

关于学习CentOS7使用firewalld打开关闭防火墙和端口的更多相关文章

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

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

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

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

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

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

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

    1.firewalld的基本使用 启动: systemctl start firewalld 关闭: systemctl stop firewalld 查看状态: systemctl status f ...

  5. CentOS7 使用firewalld打开关闭防火墙以及端口

    1.firewalld的基本使用 启动 systemctl start firewalld 关闭 systemctl stop firewalld 查看状态 systemctl status fire ...

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

    转自:http://www.cnblogs.com/moxiaoan/p/5683743.html1.firewalld的基本使用启动: systemctl start firewalld查看状态: ...

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

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

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

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

  9. Linux 之CentOS7使用firewalld打开关闭防火墙与端口

    一.firewalld的基本使用 启动: systemctl start firewalld 关闭: systemctl stop firewalld 查看状态: systemctl status f ...

随机推荐

  1. ss-R:// 链接的含义

    1.问题 ss-R:// Mi41LmZ1Y2twcHBwcC50b2RheToyNDI4ODphdXRoX2FlczEyOF9tZDU6YWVzLTI1Ni1jdHI6dGxzMS4yX3RpY2t ...

  2. [原] inline operator delete & DLL boundary

    很久以前写在百度空间的这篇文章: [百度空间] [原] 全局operator delete重载到DLL 首先,纠正一个词“重载”,operator new/delete是替换(replacement) ...

  3. NodeJS 学习笔记

    1. NodeJs的事件模型被称为非阻塞式IO或者事件驱动IO 2. Node.js 几乎每一个 API 都是支持回调函数的. 3. Node.js 基本上所有的事件机制都是用设计模式中观察者模式实现 ...

  4. Actifio OnVault 8.0

  5. Centos系统快速添加yum源

    我常用的yum源如下: 阿里云yum源:http://mirrors.aliyun.com/repo/Centos-7.repo 小红帽yum源:https://dl.fedoraproject.or ...

  6. MySQL Execution Plan--IN子查询包含超多值引发的查询异常1

    ======================================================================= SQL语句: SELECT wave_no, SUM(I ...

  7. Taro 常用 API

    table th:first-of-type { width: 300px; } Taro 常用 API 说明 网址 Taro.getSystemInfoSync() 获取系统信息同步接口. http ...

  8. H3C IRF MAD检测原理及相关问题验证

    一.IRF简介 IRF(Intelligent Resilient Framework,智能弹性架构)是H3C自主研发的软件虚拟化技术.它的核心思想是将多台设备通过IRF物理端口连接在一起,进行必要的 ...

  9. pycrypto安装出错的问题 intmax_t C:\Program Files (x86)\Windows Kits\10\include\10.0.10240.0\ucrt\inttypes.

    前言: 需要安装 Microsoft Visual Studio2017 Community 或者buildtools 解决方案一(解决了python3.7上安装pycrypto-2.6.1的错误问题 ...

  10. 必须学会git和maven

    转自: http://tieba.baidu.com/p/3458400116 很多人应该用过svn cvs之类的代码版本管理工具,git也是其中之一. svn和git最大的几个区别要点,svn必须要 ...