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. 运用Turtle实现汉诺塔的可视化运行(递归算法)

    运用Turtle实现汉诺塔的可视化运行(递归算法) 汉诺塔问题又名河内塔问题,是源于印度一个古老传说的益智玩具.大梵天创造世界的时候做了三根金刚石柱子,在一根柱子上从下往上按照大小顺序摞着64片黄金圆 ...

  2. 枪弹辩驳(弹丸论破)即将登陆PC

    Spike Chunsoft在PSP上的经典推理游戏: 枪弹辩驳1(Danganronpa: Trigger Happy Havoc)即将登陆PC, PC党有福了. 不过我在PSVita上已经玩完了两 ...

  3. flagr 数据库配置

    flagr 是一个很不错的特性开关.a/b 测试服务,默认使用的是sqlite 数据库,但是我们可以通过配置,使用不同的数据库 sqlite.mysql.postrgresql.json_file.j ...

  4. Combat 战斗任务

    发售年份 1977 平台 VCS 开发商 雅达利(Atari) 类型 射击 https://www.youtube.com/watch?v=2LxPEdUZOkE

  5. windows远程登录报错 CredSSP不支持Oracle

    https://support.microsoft.com/en-us/help/4093492/credssp-updates-for-cve-2018-0886-march-13-2018

  6. 如何让 KiCad EDA 5.1 不显示铺铜

    如何让 KiCad EDA 5.1 不显示铺铜 在画板最后给 PCB 铺地,铺地结束后检查然后发板出去打板. 板子回来焊接,调试时发现有问题,边调边改线路,打开 KiCad 一看满屏的铜皮,怎么改呀? ...

  7. Java 动态绑定

    转载  http://www.cnblogs.com/ygj0930/p/6554103.html 一:绑定 把一个方法与其所在的类/对象 关联起来叫做方法的绑定.绑定分为静态绑定(前期绑定)和动态绑 ...

  8. jupyter notebook快捷键使用指南

    Jupyter Notebook 是一个交互式笔记本程序, 其有丰富的快捷键来便捷的完成工作.Notebook 有两种键盘输入模式.即命令模式和编辑模式,这与 Vim 有些类似.在编辑模式下,可以往单 ...

  9. redis订阅发布消息操作本地缓存

    Redis 本地缓存+远程缓存方案 使用纯java的ehcache作为本地缓存 Reids 作为远程分布式缓存 解决redis缓存压力过大,提高缓存速度,以及缓存性能. Redis和ehcache缓存 ...

  10. cocos CCLayer glDrawArrays(GL_TRIANGLE_STRIP, 0, 4);ios11闪退 spine动画

    搜索一下方法,找到后替换不同内容: void PolygonBatch::flush () { if (!_verticesCount) return; GL::bindTexture2D(_text ...