
上QQ阅读APP看本书,新人免费读10天
设备和账号都新为新人
1.2 防火墙配置与管理
1.2.1 防火墙操作命令
1.概述
防火墙作为公网与内网、专用网与公共网之间的保护屏障,是两个网络之间通信时的一种访问控制,在保护数据安全性方面起着至关重要的作用。CentOS7防火墙默认使用firewall服务。
在后续部署Hadoop集群时,如果不关闭防火墙,可能会出现节点间无法通信的情况。集群一般处于同一个局域网内,关闭防火墙一般不会存在安全隐患,同时也可以通过配置防火墙规则进行端口过滤等。
2.目标
查看并更改防火墙状态。
3.准备
操作系统:CentOS 7.3。
4.考点1:firewall基本使用
(1)查看防火墙服务状态
使用status命令查看防火墙服务状态。

注:出现Active:inactive(dead)灰色表示服务停止。
(2)开启/关闭防火墙
①使用start命令开启防火墙。

注:出现Active:active(running)且高亮显示表示防火墙是启动状态。
②使用stop命令关闭防火墙。

5.考点2:关闭防火墙自启动
使用命令查看虚拟机中服务自启动列表,执行结果中显示“enabled”为自启动,“disabled”为未自启动,如图1-6所示。

图1-6 查看服务自开启列表
①使用grep命令筛选防火墙服务。

②使用disable命令关闭防火墙自启。
