You are on page 1of 229

华为认证 Security 系列教程

HCIE-Security

安全网络工程师

实验指导手册

版本:2.0

华为技术有限公司

1
版权所有 © 华为技术有限公司 2019。 保留一切权利。

非经本公司书面许可,任何单位和个人不得擅自摘抄、复制本文档内容的部分或全部,并不得以任何形式传
播。

商标声明

和其他华为商标均为华为技术有限公司的商标。

本文档提及的其他所有商标或注册商标,由各自的所有人拥有。

注意
您购买的产品、服务或特性等应受华为公司商业合同和条款的约束,本文档中描述的全部或部分产品、服务
或特性可能不在您的购买或使用范围之内。除非合同另有约定,华为公司对本文档内容不做任何明示或暗示
的声明或保证。

由于产品版本升级或其他原因,本文档内容会不定期进行更新。除非另有约定,本文档仅作为使用指导,本
文档中的所有陈述、信息和建议不构成任何明示或暗示的担保。

华为技术有限公司
地址: 深圳市龙岗区坂田华为总部办公楼 邮编:518129

网址: http://e.huawei.com

华为专有和保密信息
版权所有 © 华为技术有限公司
1

华为认证体系介绍
华为认证是华为公司基于“平台+生态”战略,围绕“云-管-端”协同的新ICT技术架
构,打造的ICT技术架构认证、平台与服务认证、行业ICT认证三类认证,是业界唯一覆盖
ICT(Information and Communications Technology 信息通信技术)全技术领域的认证
体系。
根据ICT从业者的学习和进阶需求,华为认证分为工程师级别、高级工程师级别和专家
级别三个认证等级。华为认证覆盖ICT全领域,符合ICT融合的技术趋势,致力于提供领先的
人才培养体系和认证标准,培养数字化时代新型ICT人才,构建良性ICT人才生态。
HCIE-Security(Huawei Certified ICT Expert-Security,华为认证网络通信专家网络
安全方向)主要面向华为公司办事处、代表处一线工程师,以及其他希望学习华为安全产品
技术人士。HCIE-Security认证在内容上涵盖华为网络安全基础知识、协议及组网、华为网
络安全产品特性及安全配置、网络安全高级技术及技术配置介绍等内容。
华为认证协助您打开行业之窗,开启改变之门,屹立在网络安全世界的潮头浪尖!

页 1
2

页 2
3

前 言

简介
本书为 HCIE-Security 认证培训教程,适用于准备参加 HCIE-Security 考试的学员或者希望
了解安全基础知识、防火墙协议及安全组网部署、华为安全产品特性及安全配置、安全高级技
术、故障排除等相关安全技术的读者。

内容描述
本实验指导书书共包含 9 个实验,从设备基本操作配置开始,逐一介绍了安全组网中的设备
部署,安全技术应用配置与实现。
 实验一为内容安全过滤实验,通过基本的操作与配置,帮助读者了解防火墙的内
容安全的使用场景,以及其包含的内容过滤,URL 过滤,应用行为控制的基本配
置。
 实验二为 Web 安全配置,通过模拟 SQL 注入,帮助读者掌握基本 WAF 设备部
署与配置。

 实验三介绍了防火墙的反病毒功能,重点讲解了反病毒配置文件的使用,通过本
章的实验,使读者掌握反病毒的工作原理与配置。

 实验四为网络入侵防御实验,通过模拟 XSS 攻击,帮助读者掌握了解防火墙的入


侵防御功能及配置。

 实验五 AntiDDoS 系统的部署与使用,通过讲解 AntiDDoS 系统中的引流与回注


的过程,帮助读者全面掌握 AntiDDoS 组网以及 ATIC 上的 DDoS 防范配置。
 实验六为安全组网设计实验,通过模拟园区网络中实际部署中安全的设计与配
置,帮助读者了解园区网的安全设计与安全技术的使用。
 实验七为用户管理技术实验,重点介绍用户的管理,通过 Portal 用户认证与带宽
管理讲解用户的认证与授权过程。

 实验八为 IPv6 安全技术实验,通过模拟园区网络中部署 IPv6 协议,通过 IPv6 地


址实现园区网互通的过程。

 实验九为 APT 攻击防御实验,通过使用 FireHunter 与防火墙联动,检测邮件中


的 APT 攻击,展示华为 HiSec 解决方案的部署与配置。

页 3
4

读者知识背景
本课程为华为认证基础课程,为了更好地掌握本书内容,阅读本书的读者应首先具备以下基本
条件:

 具有基本的网络安全知识背景,同时熟悉华为交换设备,了解基本数通知识。

本书常用图标

实验环境说明
组网说明
本实验环境面向准备 HCIE-Security 考试的网络安全工程师。每套实验环境包括交换机 4
台、路由器 5 台、防火墙 3 台、WAF 1 台、AntiDDoS 1 台、FireHunter 1 台、服务器一
台。服务器用于安装虚拟机,AITC、Agile Controller 以及实验中的服务器与 PC 等都安装于
服务器中。每套实验环境适用于 1~6 名学员同时上机操作。

设备介绍
为了满足 HCIE-Security 实验需要,建议每套实验环境采用以下配置:

设备名称、型号与版本的对应关系如下:

设备名称 设备型号 软件版本

SW1 S5720-36C-EI-AC V200R013C00SPC500

SW2 S5720-36C-EI-AC V200R013C00SPC500

页 4
5

SW3 S5720-36C-EI-AC V200R013C00SPC500

SW4 S5720-36C-EI-AC V200R013C00SPC500

R1 AR2240C V200R009C00SPC500

R2 AR2240C V200R009C00SPC500

R3 AR2240C V200R009C00SPC500

R4 AR2240C V200R009C00SPC500

FW1 USG6000E V600R007C00

FW2 USG6000E V600R007C00

FW3 USG6000E V600R007C00

AntiDDoS AntiDDoS1800 V600R006C00

WAF WAF5110 V200R001C00

NIP IPS6000E V600R007C00

Firehunter FireHunter6300 V100R003C50

Console Server AR2240C V200R009C00SPC500

页 5
6

实验拓扑

实验网络拓扑搭建请参考 HCIE-Security V2.0 实验室搭建指南。

清空防火墙配置
实验时,为避免残余配置对实验的影响,要求学生在实验完成后,关闭设备之前清空设备保存
的配置信息;同时,实验开始时,确认设备从空配置启动,否则执行配置清空,并重启设备。

登陆路由器需要输入密码,本实验配置的登陆密码是 Admin@123。
Login authentication
Password:Admin@123
<USG6300>reset saved-configuration
This will delete the configuration in the flash memory.
The device configurations will be erased to reconfigure.
Are you sure? (y/n)[n]:y
Clear the configuration in the device successfully.

重启控制器的命令是:
<USG6300>reboot
Info: The system is comparing the configuration, please wait.
Warning: All the configuration will be saved to the next startup configuration.
Continue ? [y/n]:n
System will reboot! Continue ? [y/n]:y
Info: system is rebooting ,please wait...

页 6
7

目录

前 言 ......................................................................................................................... 3
简介............................................................................................................................................................................................. 3

内容描述 .................................................................................................................................................................................... 3

读者知识背景 ............................................................................................................................................................................ 4

本书常用图标 ............................................................................................................................................................................ 4

实验环境说明 ............................................................................................................................................................................ 4

1 内容安全过滤实验 .................................................................................................. 12
1.1 实验介绍 .......................................................................................................................................................................... 12

1.1.1 关于本实验................................................................................................................................................................... 12

1.1.2 实验目的 ....................................................................................................................................................................... 12

1.1.3 实验组网介绍 .............................................................................................................................................................. 12

1.1.4 实验规划 ....................................................................................................................................................................... 13

1.2 实验任务配置 .................................................................................................................................................................. 14

1.2.1 配置前提 ....................................................................................................................................................................... 14

1.2.2 配置思路 ....................................................................................................................................................................... 14

1.2.3 配置步骤 ....................................................................................................................................................................... 15

1.3 结果验证 .......................................................................................................................................................................... 32

1.3.1 测试内容过滤配置 ...................................................................................................................................................... 32

1.3.2 测试应用行为控制配置 .............................................................................................................................................. 33

1.3.3 测试 URL 过滤 ............................................................................................................................................................. 34

1.4 配置参考 .......................................................................................................................................................................... 34

1.4.1 FW1 的配置 .................................................................................................................................................................. 34

1.4.2 FW2 的配置 .................................................................................................................................................................. 38

2 Web 安全防范实验 ................................................................................................. 43


2.1 实验介绍 .......................................................................................................................................................................... 43

2.1.1 关于本实验................................................................................................................................................................... 43

2.1.2 实验目的 ....................................................................................................................................................................... 43

页 7
8

2.1.3 实验组网介绍 .............................................................................................................................................................. 43

2.1.4 实验规划 ....................................................................................................................................................................... 43

2.2 实验任务配置 .................................................................................................................................................................. 44

2.2.1 配置前提 ....................................................................................................................................................................... 44

2.2.2 配置思路 ....................................................................................................................................................................... 44

2.2.3 配置步骤 ....................................................................................................................................................................... 44

2.3 结果验证 .......................................................................................................................................................................... 53

2.3.1 测试 WAF 功能............................................................................................................................................................ 53

2.4 配置参考 .......................................................................................................................................................................... 55

2.4.1 FW3 的配置 .................................................................................................................................................................. 55

3 病毒防范技术实验 .................................................................................................. 57
3.1 实验介绍 .......................................................................................................................................................................... 57

3.1.1 关于本实验................................................................................................................................................................... 57

3.1.2 实验目的 ....................................................................................................................................................................... 57

3.1.3 实验组网介绍 .............................................................................................................................................................. 57

3.1.4 实验规划 ....................................................................................................................................................................... 58

3.2 实验任务配置 .................................................................................................................................................................. 59

3.2.1 配置前提 ....................................................................................................................................................................... 59

3.2.2 配置思路 ....................................................................................................................................................................... 59

3.2.3 配置步骤 ....................................................................................................................................................................... 60

3.3 结果验证 .......................................................................................................................................................................... 63

3.3.1 验证反病毒功能 .......................................................................................................................................................... 63

3.4 配置参考 .......................................................................................................................................................................... 65

3.4.1 R1 的配置...................................................................................................................................................................... 65

3.4.2 FW1 的配置 .................................................................................................................................................................. 66

3.4.3 FW2 的配置 .................................................................................................................................................................. 69

4 网络入侵与防御 ...................................................................................................... 73
4.1 实验介绍 .......................................................................................................................................................................... 73

4.1.1 关于本实验................................................................................................................................................................... 73

4.1.2 实验目的 ....................................................................................................................................................................... 73

4.1.3 实验组网介绍 .............................................................................................................................................................. 73

页 8
9

4.1.4 实验规划 ....................................................................................................................................................................... 74

4.2 实验任务配置 .................................................................................................................................................................. 75

4.2.1 配置前提 ....................................................................................................................................................................... 75

4.2.2 配置思路 ....................................................................................................................................................................... 75

4.2.3 配置步骤 ....................................................................................................................................................................... 75

4.3 结果验证 .......................................................................................................................................................................... 80

4.3.1 验证入侵防御功能 ...................................................................................................................................................... 80

4.4 配置参考 .......................................................................................................................................................................... 81

4.4.1 R1 的配置...................................................................................................................................................................... 81

4.4.2 FW1 的配置 .................................................................................................................................................................. 82

4.4.3 FW2 的配置 .................................................................................................................................................................. 87

5 DDoS 攻击与防御 ................................................................................................... 92


5.1 实验介绍 .......................................................................................................................................................................... 92

5.1.1 关于本实验................................................................................................................................................................... 92

5.1.2 实验目的 ....................................................................................................................................................................... 92

5.1.3 实验组网介绍 .............................................................................................................................................................. 92

5.1.4 实验规划 ....................................................................................................................................................................... 93

5.2 实验任务配置 .................................................................................................................................................................. 94

5.2.1 配置前提 ....................................................................................................................................................................... 94

5.2.2 配置思路 ....................................................................................................................................................................... 95

5.2.3 配置步骤 ....................................................................................................................................................................... 95

5.3 结果验证 ....................................................................................................................................................................... 104

5.3.1 验证 DDoS 防御功能 .............................................................................................................................................. 104

5.4 配置参考 ....................................................................................................................................................................... 105

5.4.1 R1 的配置................................................................................................................................................................... 105

5.4.2 AntiDDoS 的配置 .................................................................................................................................................... 107

6 园区网安全组网设计 ............................................................................................. 111


6.1 实验介绍 ....................................................................................................................................................................... 111

6.1.1 关于本实验................................................................................................................................................................ 111

6.1.2 实验目的 .................................................................................................................................................................... 111

6.1.3 实验组网介绍 ........................................................................................................................................................... 112

页 9
10

6.1.4 实验规划 .................................................................................................................................................................... 112

6.2 实验任务配置 ............................................................................................................................................................... 114

6.2.1 配置思路 .................................................................................................................................................................... 114

6.2.2 配置步骤 .................................................................................................................................................................... 115

6.3 结果验证 ....................................................................................................................................................................... 143

6.3.1 验证双机热备功能 ................................................................................................................................................... 143

6.3.2 验证身份认证 ........................................................................................................................................................... 145

6.3.3 验证安全策略 ........................................................................................................................................................... 145

6.3.4 验证 VPN 配置 ......................................................................................................................................................... 146

6.4 配置参考 ....................................................................................................................................................................... 148

6.4.1 FW1 的配置 ............................................................................................................................................................... 148

6.4.2 FW2 的配置 ............................................................................................................................................................... 158

6.4.3 FW3 的配置 ............................................................................................................................................................... 167

6.4.4 SW3 的配置 ............................................................................................................................................................... 175

7 用户管理技术实验 ................................................................................................ 179


7.1 实验介绍 ....................................................................................................................................................................... 179

7.1.1 关于本实验................................................................................................................................................................ 179

7.1.2 实验目的 .................................................................................................................................................................... 179

7.1.3 实验组网介绍 ........................................................................................................................................................... 179

7.1.4 实验规划 .................................................................................................................................................................... 180

7.2 实验任务配置 ............................................................................................................................................................... 181

7.2.1 配置前提 .................................................................................................................................................................... 181

7.2.2 配置思路 .................................................................................................................................................................... 181

7.2.3 配置步骤 .................................................................................................................................................................... 181

7.3 结果验证 ....................................................................................................................................................................... 190

7.3.1 验证 Portal 认证 ...................................................................................................................................................... 190

7.4 配置参考 ....................................................................................................................................................................... 192

7.4.1 FW1 的配置 ............................................................................................................................................................... 192

7.4.2 FW2 的配置 ............................................................................................................................................................... 195

8 IPv6 安全技术 ...................................................................................................... 199


8.1 实验介绍 ....................................................................................................................................................................... 199

页 10
11

8.1.1 关于本实验................................................................................................................................................................ 199

8.1.2 实验目的 .................................................................................................................................................................... 199

8.1.3 实验组网介绍 ........................................................................................................................................................... 200

8.1.4 实验规划 .................................................................................................................................................................... 200

8.2 实验任务配置 ............................................................................................................................................................... 201

8.2.1 配置思路 .................................................................................................................................................................... 201

8.2.2 配置步骤 .................................................................................................................................................................... 201

8.3 结果验证 ....................................................................................................................................................................... 208

8.3.1 测试 IPv6 地址的连通性 ......................................................................................................................................... 208

8.4 配置参考 ....................................................................................................................................................................... 209

8.4.1 R3 的配置................................................................................................................................................................... 209

8.4.2 SW2 的配置 ............................................................................................................................................................... 210

8.4.3 FW3 的配置 ............................................................................................................................................................... 211

9 APT 攻击防御实验 ................................................................................................ 213


9.1 实验介绍 ....................................................................................................................................................................... 213

9.1.1 关于本实验................................................................................................................................................................ 213

9.1.2 实验目的 .................................................................................................................................................................... 213

9.1.3 实验组网介绍 ........................................................................................................................................................... 213

9.1.4 实验规划 .................................................................................................................................................................... 214

9.2 实验任务配置 ............................................................................................................................................................... 215

9.2.1 配置前提 .................................................................................................................................................................... 215

9.2.2 配置思路 .................................................................................................................................................................... 215

9.2.3 配置步骤 .................................................................................................................................................................... 215

9.3 结果验证 ....................................................................................................................................................................... 221

9.3.1 测试 APT 检测效果.................................................................................................................................................. 221

9.4 配置参考 ....................................................................................................................................................................... 222

9.4.1 FW1 的配置 ............................................................................................................................................................... 222

9.4.2 FW2 的配置 ............................................................................................................................................................... 225

页 11
12

1 内容安全过滤实验

1.1 实验介绍

1.1.1 关于本实验
某公司为保护内网安全,在网络中部署了防火墙,用于控制不同区域之间的访问流量。为了保
证企业业务的稳定运行,要求在防火墙上部署主备方式的双机热备。

1.1.2 实验目的
 掌握内容安全的应用场景

 掌握内容安全的配置方法

1.1.3 实验组网介绍

页 12
13

图1-1 内容安全过滤实验拓扑图

1.1.4 实验规划
某公司网络如图所示,分为服务器区和办公区。办公区域主要是公司的员工场所,服务器区的
服务器分为业务服务器和管理服务器(本实验只涉及对部分业务服务器的防护):

 业务服务器主要为公司或客户提供 Web 服务,Mail 服务和 FTP 服务等;

 管理服务器主要用于管理公司网络设备和认证,如 AD 服务器,Agile Controller 服务器


等。

为保证公司内网安全,需求如下:

 如果员工发送的邮件内容中包含 secret 或 password 关键字(不区分大小写),禁止发送


该邮件;

 为了防止公司机密文件的泄露,禁止员工上传文件到 FTP 服务器,只允许下载不超过


50M 的文件;

 为了保证员工的工作效率,禁止员工在工作时间(工作日的 09:00:00~17:00:00)通过
Web 服务器访问论坛。

实验 IP 地址规划

设备 端口 安全区域/IP地址

安全区域:dmz
GE1/0/0
IP地址:10.1.5.21/24

安全区域:trust
GE1/0/1
IP地址:10.1.6.21/24
FW1
安全区域:isp1,区域优先级15
GE1/0/3
IP地址:10.1.9.21/24

安全区域:dmz2,区域优先级40
GE1/0/5
IP地址:10.1.8.21/24

安全区域:dmz
GE1/0/0
IP地址:10.1.5.22/24
FW2
安全区域:trust
GE1/0/1
IP地址:10.1.6.22/24

页 13
14

安全区域:isp1,区域优先级15
GE1/0/3
IP地址:10.1.9.22/24

安全区域:dmz2,区域优先级40
GE1/0/5
IP地址:10.1.8.22/24

成员端口:GE0/0/1与GE0/0/2
Eth-trunk1
R1 IP地址:10.1.9.11/24

Eth1/0/1 10.1.40.11/24

Eth1/0/0 10.1.6.14/24
R4
Eth1/0/1 10.1.3.14/24

GE0/0/9 10.1.3.3/24
SW3
GE1/0/10 10.1.2.3/24

PC1 / 10.1.2.101/32

FTP服务器 / 10.1.5.108/32

Mail服务器 / 10.1.5.109/32

Web服务器 / 10.1.5.110/32

1.2 实验任务配置

1.2.1 配置前提
各设备上的 IP 地址无需配置。

路由器,交换机上的路由协议不需要配置,学员只需要在防火墙上进行操作。

1.2.2 配置思路
1. 公司网络中根据规划配置安全区域,运行 OSPF 协议学习全网路由,所有设备都在骨干区
域。

2. 为防止总部防火墙单点故障,在 FW1 与 FW2 上部署双机热备,FW1 为主设备,FW2 为


备份设备,所有服务器的网关地址都为 VRRP 组 1 的虚地址 10.1.5.254/24;配置 Link-
Group,当 FW1 上下行链路出现故障时,FW2 切换为主设备。

页 14
15

3. 配置内容安全,控制员工访问服务器的流量。

1.2.3 配置步骤
步骤 1 配置安全区域

使用防火墙的管理地址登录防火墙,配置安全区域,并根据规划将接口加入安全区域。

# 在 FW1 上创建安全区域 isp1 和 dmz2,选择“网络>接口>安全区域”在安全区域列表中


创建安全区域,并将接口接入安全区域,如下图。

页 15
16

# 配置完成后,选择“网络>接口”,检查配置信息如下。

# 在 FW2 上创建安全区域 isp1 和 dmz2,选择“网络>接口>安全区域”在安全区域列表中


创建安全区域,并将接口接入安全区域,如下图。

页 16
17

页 17
18

# 配置完成后,选择“网络>接口”,检查配置信息如下。

步骤 2 配置路由协议

在 FW1 和 FW2 上配置 OSPF 路由协议,所有路由宣告在 Area 0 中。

# 在 FW1 上选择“网络>路由>OSPF”,在 OSPF 列表中,配置 OSPF 协议,如下图。

# 配置完成后,点击“高级”,创建区域 0,宣告路由 10.1.5.0/24,10.1.6.0/24 和


10.1.9.0/24。

页 18
19

# 在 FW2 上选择“网络>路由>OSPF”,在 OSPF 列表中,配置 OSPF 协议,如下图。

页 19
20

# 配置完成后,点击“高级”,创建区域 0,宣告路由 10.1.5.0/24,10.1.6.0/24 和


10.1.9.0/24。

页 20
21

步骤 3 配置双机热备

为防止总部网络出现单点故障,在 FW1 上和 FW2 上开启双机热备功能。FW1 作为主设备,


FW2 作为备份设备;在 DMZ 区域的所有服务器网关的 IP 地址为 10.1.5.254,即虚拟网关地
址;心跳线接口为 GE1/0/5。

# 在 FW1 上选择“系统>高可靠性>双机热备”。点击“配置”,设置双机热备参数,如下
图。

页 21
22

# 在 FW2 上选择“系统>高可靠性>双机热备”。点击“配置”,设置双机热备参数,如下
图。

# 配置完成后,在 FW1 和 FW2 上检查防火墙状态,如下图。

页 22
23

在 FW1 上配置 Link-Group,当上下行链路出现故障或心跳接口出现故障时,FW2 能够及时


切换成主设备。

# 在 FW1 上选择“系统>高可靠性>Link-Group”。在 Link-Group 列表中点击“Link-


Group 号 1”,将 GE1/0/0,GE GE1/0/1,GE1/0/3 和 GE1/0/5 加入 Link-Group 组,如下
图。

步骤 4 配置内容安全

如果员工发送的邮件内容中包含 secret 或 password 关键字(不区分大小写),禁止发送该邮


件。

# 在 FW1 上选择“对象>关键字组”。新建关键字组名称为 key_words,关键字内容分别为


secret 和 password,如下图。

页 23
24

# 配置完成后,检查如下。

# 在 FW1 上选择“对象>安全配置文件>内容过滤”。新建内容过滤配置文件,如下图。

页 24
25

# 配置完成后,点击“提交”进行编译。

# 配置安全策略,在 FW1 上选择“策略>安全策略>安全策略”。在安全策略列表中点击“新


建安全策略”,在安全策略中调用安全配置文件,如下图。

页 25
26

为了防止公司机密文件的泄露,禁止员工上传文件到 FTP 服务器,只允许下载不超过 50M 的


文件。

# 在 FW1 上选择“对象>安全配置文件>应用行为控制”。新建应用行文控制配置文件,FTP
行为控制如下图,HTTP 行为控制与 IM 行为控制为禁止。

页 26
27

页 27
28

# 配置完成后,点击“提交”进行编译。

# 配置安全策略,在 FW1 上选择“策略>安全策略>安全策略”。在安全策略列表中点击


“新建安全策略”,在安全策略中调用安全配置文件,如下图。

页 28
29

为了保证员工的工作效率,禁止员工在工作时间(工作日的 09:00:00~17:00:00)通过 Web


服务器访问论坛。

# 在 FW1 上选择“对象>时间段”。在“时间段列表中”单击新建,配置工作时间为
09:00:00~17:00:00,如下图。

页 29
30

# 在 FW1 上选择“对象>安全配置文件>URL 过滤”。单击新建,配置 URL 过滤配置文件,


论坛的动作为“阻断”,如下图。

页 30
31

# 配置完成后,点击“提交”进行编译。

# 配置安全策略,在 FW1 上选择“策略>安全策略>安全策略”。在安全策略列表中点击


“新建安全策略”,在安全策略中调用安全配置文件,如下图。

页 31
32

1.3 结果验证

1.3.1 测试内容过滤配置
使用 PC1 模拟办公区员工,访问服务器区资源。

# 在 PC1 上使用火狐浏览器发送给 user2@security.com 发送一封邮件,邮件内容包含


secret 或 password 关键字,如下图。

点击“发送”后,弹出提示信息,表明邮件被拦截,如下图。

页 32
33

# 在防火墙上查看“监控>日志>业务日志”,发现内容过滤日志,表明防火墙丢弃了邮件信
息。

1.3.2 测试应用行为控制配置
# 登录 PC1,打开任意文件夹,在搜索栏输入下图地址,连接 FTP 服务器。

# 点击“回车”后,使用用户名/密码:user1/Huawei@123 登录 FTP 服务器。

页 33
34

# 尝试上传一个名为 test.txt 的文件,提示如下,表明文件被拦截。

# 在防火墙上查看“监控>日志>业务日志”,应用行为控制日志表明防火墙丢弃了上传 FTP
的文件。

1.3.3 测试 URL 过滤
# 在非工作时间,登录 FW1,查看配置的 URL 过滤安全策略,信息如下图,表明非工作时间
策略不生效,员工可以访问论坛。

# 在工作时间,登录 FW1,查看配置的 URL 过滤安全策略,信息如下图,表明工作时间策略


生效,员工不可以访问论坛。

1.4 配置参考

1.4.1 FW1 的配置


#
sysname FW1
#
hrp enable
hrp interface GigabitEthernet1/0/5 remote 10.1.8.22
#
time-range working_time
period-range 09:00:00 to 17:00:00 working-day

页 34
35

#
interface GigabitEthernet1/0/0
undo shutdown
ip address 10.1.5.21 255.255.255.0
vrrp vrid 1 virtual-ip 10.1.5.254 active
vrrp virtual-mac enable
link-group 1
service-manage ping permit
#
interface GigabitEthernet1/0/1
undo shutdown
ip address 10.1.6.21 255.255.255.0
link-group 1
service-manage ping permit
#
interface GigabitEthernet1/0/3
undo shutdown
ip address 10.1.9.21 255.255.255.0
link-group 1
service-manage ping permit
#
interface GigabitEthernet1/0/5
undo shutdown
ip address 10.1.8.21 255.255.255.0
link-group 1
service-manage ping permit
#
firewall zone trust
set priority 85
add interface GigabitEthernet1/0/1
#
firewall zone untrust
set priority 5
#
firewall zone dmz
set priority 50
add interface GigabitEthernet1/0/0
#
firewall zone name isp1 id 4
set priority 15
add interface GigabitEthernet1/0/3
#

页 35
36

firewall zone name dmz2 id 5


set priority 40
add interface GigabitEthernet1/0/5
#
ospf 1 router-id 21.21.21.21
area 0.0.0.0
network 10.1.5.0 0.0.0.255
network 10.1.6.0 0.0.0.255
network 10.1.9.0 0.0.0.255
#
profile type url-filter name URL_filter
category pre-defined subcategory-id 101 action block
category pre-defined subcategory-id 108 action block
category pre-defined subcategory-id 251 action block
category pre-defined subcategory-id 177 action block
category pre-defined subcategory-id 109 action block
category pre-defined subcategory-id 115 action block
category pre-defined subcategory-id 180 action block
category pre-defined subcategory-id 181 action block
category pre-defined subcategory-id 122 action block
category pre-defined subcategory-id 182 action block
category pre-defined subcategory-id 183 action block
category pre-defined subcategory-id 184 action block
category pre-defined subcategory-id 126 action block
category pre-defined subcategory-id 190 action block
category pre-defined subcategory-id 135 action block
category pre-defined subcategory-id 143 action block
category pre-defined subcategory-id 240 action block
category pre-defined subcategory-id 146 action block
category pre-defined subcategory-id 147 action block
category pre-defined subcategory-id 149 action block
category pre-defined subcategory-id 152 action block
category pre-defined subcategory-id 238 action block
category pre-defined subcategory-id 155 action block
category pre-defined subcategory-id 224 action block
category pre-defined subcategory-id 225 action block
category pre-defined subcategory-id 156 action block
category pre-defined subcategory-id 157 action block
category pre-defined subcategory-id 158 action block
category pre-defined subcategory-id 231 action block
category pre-defined subcategory-id 232 action block
category pre-defined subcategory-id 159 action block

页 36
37

category pre-defined subcategory-id 254 action block


category pre-defined subcategory-id 160 action block
category pre-defined subcategory-id 176 action block
category pre-defined subcategory-id 226 action block
category pre-defined subcategory-id 234 action block
category pre-defined subcategory-id 235 action block
category pre-defined subcategory-id 237 action block
category pre-defined subcategory-id 239 action block
#
profile type app-control name Behavior_control
http-control web-browse action deny
http-control proxy action deny
http-control post action deny
http-control file direction upload action deny
http-control file direction download action deny
ftp-control file delete action deny
ftp-control file direction upload action deny
ftp-control file direction download alert-size 50000
ftp-control file direction download block-size 50001
im-control qq action deny
#
keyword-group name key_words
user-defined-keyword name password
expression match-mode text password
undo case-sensitive enable
user-defined-keyword name secret
expression match-mode text secret
undo case-sensitive enable
#
profile type data-filter name Content_filter
rule name Content_filter
keyword-group name key_words
file-type all
application type SMTP POP3 IMAP
action block
#
security-policy
rule name "Employee_to_Mail Server"
source-zone dmz
source-zone trust
destination-zone dmz
destination-zone trust

页 37
38

source-address 10.1.2.0 mask 255.255.255.0


source-address 10.1.5.109 mask 255.255.255.255
destination-address 10.1.2.0 mask 255.255.255.0
destination-address 10.1.5.109 mask 255.255.255.255
profile data-filter Content_filter
action permit
rule name "Employee_to_FTP Server"
source-zone dmz
source-zone trust
destination-zone dmz
destination-zone trust
source-address 10.1.2.0 mask 255.255.255.0
source-address 10.1.5.108 mask 255.255.255.255
destination-address 10.1.2.0 mask 255.255.255.0
destination-address 10.1.5.108 mask 255.255.255.255
service ftp
profile app-control Behavior_control
action permit
rule name "Employee_to_Web Server"
source-zone dmz
source-zone trust
destination-zone dmz
destination-zone trust
source-address 10.1.2.0 mask 255.255.255.0
source-address 10.1.5.110 mask 255.255.255.255
destination-address 10.1.2.0 mask 255.255.255.0
destination-address 10.1.5.110 mask 255.255.255.255
service http
service https
time-range working_time
profile url-filter URL_filter
action permit
#
return

1.4.2 FW2 的配置


#
sysname FW2
#
hrp enable
hrp standby-device

页 38
39

hrp interface GigabitEthernet1/0/5 remote 10.1.8.21


#
time-range working_time
period-range 09:00:00 to 17:00:00 working-day
#
interface GigabitEthernet1/0/0
undo shutdown
ip address 10.1.5.22 255.255.255.0
vrrp vrid 1 virtual-ip 10.1.5.254 standby
vrrp virtual-mac enable
service-manage ping permit
#
interface GigabitEthernet1/0/1
undo shutdown
ip address 10.1.6.22 255.255.255.0
service-manage ping permit
#
interface GigabitEthernet1/0/3
undo shutdown
ip address 10.1.9.22 255.255.255.0
service-manage ping permit
#
interface GigabitEthernet1/0/5
undo shutdown
ip address 10.1.8.22 255.255.255.0
service-manage ping permit
#
firewall zone trust
set priority 85
add interface GigabitEthernet1/0/1
#
firewall zone dmz
set priority 50
add interface GigabitEthernet1/0/0
#
firewall zone name isp1 id 4
set priority 15
add interface GigabitEthernet1/0/3
#
firewall zone name dmz2 id 5
set priority 40
add interface GigabitEthernet1/0/5

页 39
40

#
ospf 1 router-id 22.22.22.22
area 0.0.0.0
network 10.1.5.0 0.0.0.255
network 10.1.6.0 0.0.0.255
network 10.1.9.0 0.0.0.255
#
profile type url-filter name URL_filter
category pre-defined subcategory-id 101 action block
category pre-defined subcategory-id 108 action block
category pre-defined subcategory-id 251 action block
category pre-defined subcategory-id 177 action block
category pre-defined subcategory-id 109 action block
category pre-defined subcategory-id 115 action block
category pre-defined subcategory-id 180 action block
category pre-defined subcategory-id 181 action block
category pre-defined subcategory-id 122 action block
category pre-defined subcategory-id 182 action block
category pre-defined subcategory-id 183 action block
category pre-defined subcategory-id 184 action block
category pre-defined subcategory-id 126 action block
category pre-defined subcategory-id 190 action block
category pre-defined subcategory-id 135 action block
category pre-defined subcategory-id 143 action block
category pre-defined subcategory-id 240 action block
category pre-defined subcategory-id 146 action block
category pre-defined subcategory-id 147 action block
category pre-defined subcategory-id 149 action block
category pre-defined subcategory-id 152 action block
category pre-defined subcategory-id 238 action block
category pre-defined subcategory-id 155 action block
category pre-defined subcategory-id 224 action block
category pre-defined subcategory-id 225 action block
category pre-defined subcategory-id 156 action block
category pre-defined subcategory-id 157 action block
category pre-defined subcategory-id 158 action block
category pre-defined subcategory-id 231 action block
category pre-defined subcategory-id 232 action block
category pre-defined subcategory-id 159 action block
category pre-defined subcategory-id 254 action block
category pre-defined subcategory-id 160 action block
category pre-defined subcategory-id 176 action block

页 40
41

category pre-defined subcategory-id 226 action block


category pre-defined subcategory-id 234 action block
category pre-defined subcategory-id 235 action block
category pre-defined subcategory-id 237 action block
category pre-defined subcategory-id 239 action block
#
profile type app-control name Behavior_control
http-control web-browse action deny
http-control proxy action deny
http-control post action deny
http-control file direction upload action deny
http-control file direction download action deny
ftp-control file delete action deny
ftp-control file direction upload action deny
ftp-control file direction download alert-size 50000
ftp-control file direction download block-size 50001
im-control qq action deny
#
keyword-group name key_words
user-defined-keyword name password
expression match-mode text password
undo case-sensitive enable
user-defined-keyword name secret
expression match-mode text secret
undo case-sensitive enable
#
profile type data-filter name Content_filter
rule name Content_filter
keyword-group name key_words
file-type all
application type SMTP POP3 IMAP
action block
#
security-policy
rule name "Employee_to_Mail Server"
source-zone dmz
source-zone trust
destination-zone dmz
destination-zone trust
source-address 10.1.2.0 mask 255.255.255.0
source-address 10.1.5.109 mask 255.255.255.255
destination-address 10.1.2.0 mask 255.255.255.0

页 41
42

destination-address 10.1.5.109 mask 255.255.255.255


profile data-filter Content_filter
action permit
rule name "Employee_to_FTP Server"
source-zone dmz
source-zone trust
destination-zone dmz
destination-zone trust
source-address 10.1.2.0 mask 255.255.255.0
source-address 10.1.5.108 mask 255.255.255.255
destination-address 10.1.2.0 mask 255.255.255.0
destination-address 10.1.5.108 mask 255.255.255.255
service ftp
profile app-control Behavior_control
action permit
rule name "Employee_to_Web Server"
source-zone dmz
source-zone trust
destination-zone dmz
destination-zone trust
source-address 10.1.2.0 mask 255.255.255.0
source-address 10.1.5.110 mask 255.255.255.255
destination-address 10.1.2.0 mask 255.255.255.0
destination-address 10.1.5.110 mask 255.255.255.255
service http
service https
time-range working_time
profile url-filter URL_filter
action permit
#
return

页 42
43

2 Web 安全防范实验

2.1 实验介绍

2.1.1 关于本实验
某公司在网络边界处部署了防火墙作为安全网关,内网 DMZ 区域部署 Web 服务器对外提供
Web 服务。为保护 Web 服务器安全,在 Web 服务器前端部署 WAF 设备。

2.1.2 实验目的
 掌握 WAF 的应用场景

 掌握 WAF 的配置方法

2.1.3 实验组网介绍

图2-1 Web 安全防范实验拓扑图

2.1.4 实验规划
公司网络中部署了一台 Web 服务器,对外提供 Web 服务,所以需要在 FW3 上配置 NAT
Server 进行地址映射。

为保护 Web 服务安全,在 Web 服务器前端部署 WAF 设备,WAF 设备以透明接入的方式部


署在网络中。

PC2 模拟互联网上的攻击者,在访问 Web 服务器时,发动 SQL 注入攻击。

页 43
44

实验设备信息

设备 端口 安全区域/IP地址

安全区域:untrust
GE1/0/0
IP地址:10.1.70.23/24
FW3
安全区域:dmz
GE1/0/1
IP地址:10.1.22.23/24

GE0/0/1 10.1.32.13/24
R3
GE0/0/2 10.1.60.13/24

PC2 / 10.1.32.102/32

Web服务器 / 10.1.22.104/32

2.2 实验任务配置

2.2.1 配置前提
各设备上的 IP 地址无需配置。

路由器上的路由协议不需要配置,学员只需要在防火墙上进行操作。

2.2.2 配置思路
1. 配置安全域和路由,在 FW3 上将相应接口加入安全域,并配置去往 Internet 的默认路
由。

2. 配置 NAT Server,在 FW3 上将 Web Server 的私网地址映射成为公网地址。

3. 配置 WAF 设备,在 WAF 设备上配置策略,防御 SQL 注入攻击。

2.2.3 配置步骤
步骤 1 配置安全域和路由

根据实验规划,将 FW3 上的接口加入相应的安全域,并配置一条默认路由,下一跳为互联网


地址 10.1.70.2。

页 44
45

# 在 FW3 上选择“网络>接口>安全区域”,点击相应安全区域的编辑按钮,将接口接入安全
区域,如下图。

# 配置完成后,选择“网络>接口”,检查配置信息如下。

在 FW3 上配置去往 Internet 的默认路由,下一跳为 10.1.70.2。

# 在 FW3 上选择“网络>路由>静态路由”,在静态路由列表中,配置默认路由,如下图。

页 45
46

步骤 2 配置 NAT Server

在 FW3 上配置 NAT Server,将私网地址 10.1.22.104 映射为公网地址 10.1.70.104。

# 在 FW3 上选择“策略>NAT 策略>服务器映射”。在服务器映射列表中点击“新建”,设置


参数,如下图。

配置完成后,在 FW3 上配置安全策略,放行 Internet 客户访问分支 Web 服务器的流量。

# 在 FW3 上选择“策略>安全策略>安全策略”。在安全策略列表中点击“新建安全策略”

设置参数,如下图。

页 46
47

步骤 3 配置 WAF

在 WAF 设备上配置策略,保护内网 Web 服务器的安全。

# 在 WAF 上配置名为 Web Server 的规则组。选择“策略>规则组>新建规则组”,规则模板


调用“预设规则”,如图所示。

# 配置完成后,修改预设规则,选中配置的“Web Server”规则,在“注入攻击”中,启用
代码注入和命令行注入,如下图。

页 47
48

# 启用后,如下图,并“应用更改”。

页 48
49

页 49
50

# 配置的 Web Server 规则组,默认仅用于检测,需要将该规则组启用后,才能进行攻击防


御,点击“配置”按钮进行修改。

# 将规则引擎改为“启用”后,点击“保存更改”,如下图。

页 50
51

# 配置保护站点,对于访问 Web 服务器的流量应用配置的规则引擎。选择“配置>保护站


点>添加保护站点”,如下图。

# 配置保护站点信息如下图,调用上述步骤中配置的策略规则,其他参数保持不变,最后点
击“保存”。

页 51
52

# 配置完成后,需要再次点击“应用更改”,如下图。

页 52
53

2.3 结果验证

2.3.1 测试 WAF 功能
登录 PC2,模拟攻击者访问 Web 服务器。

# 在 PC2 上打开浏览器,输入连接 http://10.1.70.104/web/index.html,查看能否正常访


问,如下图。

# 上图表明,正常访问可以连接到 Web Server。

# 在 PC2 上链接中加入 SQL 注入的语句,模拟注入攻击,如下图,查看能够正常访问。

页 53
54

# 上图表明,访问被阻断。

# 登录 WAF 设备,选择“日志>应用防护日志”,查看到 WAF 上阻断访问流量的日志,如


下图。

# 点击日志记录,查看具体信息如下。

页 54
55

2.4 配置参考

2.4.1 FW3 的配置


#
sysname FW3
#
interface GigabitEthernet1/0/0
undo shutdown
ip address 10.1.70.23 255.255.255.0
service-manage ping permit
#
interface GigabitEthernet1/0/1
undo shutdown
ip address 10.1.22.23 255.255.255.0
service-manage ping permit
#
firewall zone untrust
set priority 5
add interface GigabitEthernet1/0/0
#
firewall zone dmz

页 55
56

set priority 50
add interface GigabitEthernet1/0/1
#
ip route-static 0.0.0.0 0.0.0.0 10.1.70.2
#
nat server Web_Server zone untrust global 10.1.70.104 inside 10.1.22.104 no-
reverse unr-route
#
security-policy
rule name "Outbound_to_Web Server"
source-zone untrust
destination-zone dmz
destination-address 10.1.22.104 mask 255.255.255.255
action permit
#
return

页 56
57

3 病毒防范技术实验

3.1 实验介绍

3.1.1 关于本实验
某公司在网络边界处部署了防火墙作为安全网关,公司内部网络规划了办公区域和服务器区
域。公司的服务器区域部署了 Mail 服务器并对 Internet 客户提供 Mail 服务。为防御来自
Internet 的病毒或内网办公区域的病毒感染服务器,在防火墙上部署反病毒功能进行防范。

3.1.2 实验目的
 了解反病毒功能的应用场景

 掌握反病毒功能的配置方法

3.1.3 实验组网介绍

页 57
58

图3-1 病毒防范实验拓扑图

3.1.4 实验规划
某公司网络如图所示,公司网络分为服务器区和办公区。办公区域主要是公司的员工场所;服
务器区的服务器分为业务服务器和管理服务器(本实验只涉及对部分业务服务器的防护):

 业务服务器主要为公司或客户提供 Web 服务,Mail 服务和 FTP 服务等;

 管理服务器主要用于管理公司网络设备和认证,如 AD 服务器,Agile Controller 服务器


等。

运营商网络主要用于模拟公司出差员工或公司客户通过互联网访问公司服务器资源的场景。

实验 IP 地址规划

设备 端口 安全区域/IP地址

安全区域:dmz
GE1/0/0
IP地址:10.1.5.21/24

安全区域:trust
GE1/0/1
IP地址:10.1.6.21/24
FW1
安全区域:isp1,区域优先级15
GE1/0/3
IP地址:10.1.9.21/24

安全区域:dmz2,区域优先级40
GE1/0/5
IP地址:10.1.8.21/24

安全区域:dmz
GE1/0/0
IP地址:10.1.5.22/24

安全区域:trust
GE1/0/1
IP地址:10.1.6.22/24
FW2
安全区域:isp1,区域优先级15
GE1/0/3
IP地址:10.1.9.22/24

安全区域:dmz2,区域优先级40
GE1/0/5
IP地址:10.1.8.22/24

R1 Eth-trunk1 成员端口:GE0/0/1与GE0/0/2

页 58
59

IP地址:10.1.9.11/24

Eth1/0/1 10.1.40.11/24

GE0/0/1 10.1.32.13/24
R3
GE0/0/2 10.1.60.13/24

Eth1/0/0 10.1.6.14/24
R4
Eth1/0/1 10.1.3.14/24

GE0/0/9 10.1.3.3/24
SW3
GE1/0/10 10.1.2.3/24

PC1 / 10.1.2.101/32

PC2 / 10.1.32.102/32

园区Mail服务器 / 10.1.5.109/32

3.2 实验任务配置

3.2.1 配置前提
各设备上的 IP 地址无需配置。

路由器,交换机上的动态路由协议不需要配置,学员只需要在防火墙上进行操作。

参照实验 1 的实验内容完成公司园区网络的安全区域,路由协议以及双机热备的部署,本实
验不再重复展示配置内容。

3.2.2 配置思路
1. 部署静态路由,在 R1 上配置默认路由,下一跳为 10.1.40.2,实现园区网络与 Internet 互
通。

2. 部署 NAT Server,将 Mail 服务器的私网地址映射成为公网地址 10.1.40.109,为


Internet 用户提供服务。

3. 部署反病毒功能,防御内外网的病毒感染 Mail 服务器。

页 59
60

3.2.3 配置步骤
步骤 1 配置静态路由

在 R1 上配置默认路由,下一跳为 10.1.40.2,实现园区网络与 Internet 的互通。

# 在 R1 上配置去往 Internet 的默认路由,下一跳为 10.1.40.2。


<R1>system-view
[R1]ip route-static 0.0.0.0 0 10.1.40.2

步骤 2 配置 NAT

在 R1 上配置 NAT Server,将园区网内的 Mail 服务器私网地址 10.1.5.109 映射为公网地址


10.1.40.109,对外提供服务。

# 在接口上配置 NAT Server。


[R1]interface Ethernet1/0/1
[R1-Ethernet1/0/1]nat server global 10.1.40.109 inside 10.1.5.109 description
Mail_Server

在 FW1 上放行外网到 Mail 服务器的流量。

# 在 FW1 上选择“策略>安全策略>安全策略”。在安全策略列表中点击“新建安全策略”

设置参数,如下图。

步骤 3 配置反病毒功能

为防御内外网病毒感染 Mail 服务器,对邮件进行病毒检查,如果发现邮件中存在病毒,删除


邮件附件。邮件删除后,为用户推送通知信息。

页 60
61

# 在 FW1 上选择“对象>安全配置文件>反病毒”。新建反病毒配置文件,如下图。

# 配置完成后,点击“提交”进行编译。

# 配置安全策略,当 Internet 客户访问 Mail 服务器时,对流量进行病毒检查;当内网用户访


问 Mail 服务器时,对流量进行病毒检查。

# 在 FW1 上选择“策略>安全策略>安全策略”,在安全策略中调用安全配置文件,如下图。

页 61
62

# 配置推送信息,当邮件被删除后,通知用户。选择“系统>配置>推送信息配置”,在配置
推送信息列表中,导出“邮件删除附件信息”模板,编辑模板信息,如下图。

页 62
63

# 修改完成后,导入模板文件,如下图。

3.3 结果验证

3.3.1 验证反病毒功能
# 登录 PC2,模拟 Internet 客户发送邮件给 PC1(邮箱为 user1@huawei.com),附件携带
病毒文件,验证反病毒功能,如下图。

页 63
64

# 登录 PC1,查看收到的邮件。

# 上图表明,邮件附件被删除,并且使用通知模板通告了用户。

# 登录防火墙 FW1,在防火墙上查看“监控>日志>业务日志”,反病毒日志表明防火墙删除
了附件文件,如下图。

页 64
65

# PC1 模拟内网用户发送携带病毒的邮件,效果相同,不再赘述,请自行测试。

3.4 配置参考

3.4.1 R1 的配置
#

sysname R1

interface Eth-Trunk1

undo portswitch

description to_FW1&FW2

ip address 10.1.9.11 255.255.255.0

interface Ethernet1/0/1

ip address 10.1.40.11 255.255.255.0

nat server global 10.1.40.109 inside 10.1.5.109 description Mail_Server

interface GigabitEthernet0/0/1

eth-trunk 1

interface GigabitEthernet0/0/2

eth-trunk 1

ospf 1

default-route-advertise always

area 0.0.0.0

network 10.1.9.0 0.0.0.255

ip route-static 0.0.0.0 0.0.0.0 10.1.40.2

页 65
66

return

3.4.2 FW1 的配置


#

sysname FW1

hrp enable

hrp interface GigabitEthernet1/0/5 remote 10.1.8.22

interface GigabitEthernet1/0/0

undo shutdown

ip address 10.1.5.21 255.255.255.0

vrrp vrid 1 virtual-ip 10.1.5.254 active

vrrp virtual-mac enable

link-group 1

service-manage ping permit

interface GigabitEthernet1/0/1

undo shutdown

ip address 10.1.6.21 255.255.255.0

link-group 1

service-manage ping permit

interface GigabitEthernet1/0/3

undo shutdown

ip address 10.1.9.21 255.255.255.0

link-group 1

service-manage ping permit

interface GigabitEthernet1/0/5

undo shutdown

页 66
67

ip address 10.1.8.21 255.255.255.0

link-group 1

service-manage ping permit

firewall zone trust

set priority 85

add interface GigabitEthernet1/0/1

firewall zone dmz

set priority 50

add interface GigabitEthernet1/0/0

firewall zone name isp1 id 4

set priority 15

add interface GigabitEthernet1/0/3

firewall zone name dmz2 id 5

set priority 40

add interface GigabitEthernet1/0/5

ospf 1 router-id 21.21.21.21

area 0.0.0.0

network 10.1.5.0 0.0.0.255

network 10.1.6.0 0.0.0.255

network 10.1.9.0 0.0.0.255

profile type av name AntiVirus

undo http-detect

undo ftp-detect

smtp-detect action delete-attachment

页 67
68

pop3-detect action delete-attachment

imap-detect direction both action delete-attachment

undo nfs-detect

undo smb-detect

keyword-group name key_words

user-defined-keyword name password

expression match-mode text password

undo case-sensitive enable

user-defined-keyword name secret

expression match-mode text secret

undo case-sensitive enable

profile type data-filter name Content_filter

rule name Content_filter

keyword-group name key_words

file-type all

application type SMTP POP3 IMAP

action block

security-policy

rule name "Outbound_to_Mail Server"

source-zone isp1

destination-zone dmz

destination-address 10.1.5.109 mask 255.255.255.255

profile av AntiVirus

action permit

rule name "Employee_to_Mail Server"

source-zone dmz

source-zone trust

页 68
69

destination-zone dmz

destination-zone trust

source-address 10.1.2.0 mask 255.255.255.0

source-address 10.1.5.109 mask 255.255.255.255

destination-address 10.1.2.0 mask 255.255.255.0

destination-address 10.1.5.109 mask 255.255.255.255

profile av AntiVirus

profile data-filter Content_filter

action permit

return

3.4.3 FW2 的配置


#

sysname FW2

hrp enable

hrp standby-device

hrp interface GigabitEthernet1/0/5 remote 10.1.8.21

interface GigabitEthernet1/0/0

undo shutdown

ip address 10.1.5.22 255.255.255.0

vrrp vrid 1 virtual-ip 10.1.5.254 standby

vrrp virtual-mac enable

service-manage ping permit

interface GigabitEthernet1/0/1

undo shutdown

ip address 10.1.6.22 255.255.255.0

service-manage ping permit

页 69
70

interface GigabitEthernet1/0/3

undo shutdown

ip address 10.1.9.22 255.255.255.0

service-manage ping permit

interface GigabitEthernet1/0/5

undo shutdown

ip address 10.1.8.22 255.255.255.0

service-manage ping permit

firewall zone trust

set priority 85

add interface GigabitEthernet1/0/1

firewall zone dmz

set priority 50

add interface GigabitEthernet1/0/0

firewall zone name isp1 id 4

set priority 15

add interface GigabitEthernet1/0/3

firewall zone name dmz2 id 5

set priority 40

add interface GigabitEthernet1/0/5

ospf 1 router-id 22.22.22.22

area 0.0.0.0

network 10.1.5.0 0.0.0.255

页 70
71

network 10.1.6.0 0.0.0.255

network 10.1.9.0 0.0.0.255

profile type av name AntiVirus

undo http-detect

undo ftp-detect

smtp-detect action delete-attachment

pop3-detect action delete-attachment

imap-detect direction both action delete-attachment

undo nfs-detect

undo smb-detect

keyword-group name key_words

user-defined-keyword name password

expression match-mode text password

undo case-sensitive enable

user-defined-keyword name secret

expression match-mode text secret

undo case-sensitive enable

profile type data-filter name Content_filter

rule name Content_filter

keyword-group name key_words

file-type all

application type SMTP POP3 IMAP

action block

security-policy

rule name "Outbound_to_Mail Server"

source-zone isp1

页 71
72

destination-zone dmz

destination-address 10.1.5.109 mask 255.255.255.255

profile av AntiVirus

action permit

rule name "Employee_to_Mail Server"

source-zone dmz

source-zone trust

destination-zone dmz

destination-zone trust

source-address 10.1.2.0 mask 255.255.255.0

source-address 10.1.5.109 mask 255.255.255.255

destination-address 10.1.2.0 mask 255.255.255.0

destination-address 10.1.5.109 mask 255.255.255.255

profile av AntiVirus

profile data-filter Content_filter

action permit

return

页 72
73

4 网络入侵与防御

4.1 实验介绍

4.1.1 关于本实验
某公司在网络边界处部署了防火墙作为安全网关,公司内部网络规划了办公区域和服务器区
域。公司的服务器区域部署了 Web 服务器并对 Internet 客户提供 Web 服务。为防止来自
Internet 或内网办公区域的非法行为入侵服务器,在防火墙上开启入侵防御功能。

4.1.2 实验目的
 掌握入侵防御的应用场景

 掌握入侵防御功能的配置方法

4.1.3 实验组网介绍

页 73
74

图4-1 网络入侵防御实验拓扑图

4.1.4 实验规划
某公司网络如图所示,公司网络分为服务器区和办公区。办公区域主要是公司的员工场所;服
务器区的服务器分为业务服务器和管理服务器(本实验只涉及对部分业务服务器的防护):

 业务服务器主要为公司或客户提供 Web 服务,Mail 服务和 FTP 服务等;

 管理服务器主要用于管理公司网络设备和认证,如 AD 服务器,Agile Controller 服务器


等。

运营商网络主要用于模拟公司出差员工或公司客户通过互联网访问公司服务器资源的场景。

实验设备信息

设备 端口 安全区域/IP地址

安全区域:dmz
GE1/0/0
IP地址:10.1.5.21/24

安全区域:trust
GE1/0/1
IP地址:10.1.6.21/24
FW1
安全区域:isp1,区域优先级15
GE1/0/3
IP地址:10.1.9.21/24

安全区域:dmz2,区域优先级40
GE1/0/5
IP地址:10.1.8.21/24

安全区域:dmz
GE1/0/0
IP地址:10.1.5.22/24

安全区域:trust
GE1/0/1
IP地址:10.1.6.22/24
FW2
安全区域:isp1,区域优先级15
GE1/0/3
IP地址:10.1.9.22/24

安全区域:dmz2,区域优先级40
GE1/0/5
IP地址:10.1.8.22/24

R1 Eth-trunk1 成员端口:GE0/0/1与GE0/0/2

页 74
75

IP地址:10.1.9.11/24

Eth1/0/1 10.1.40.11/24

GE0/0/1 10.1.32.13/24
R3
GE0/0/2 10.1.60.13/24

Eth1/0/0 10.1.6.14/24
R4
Eth1/0/1 10.1.3.14/24

GE0/0/9 10.1.3.3/24
SW3
GE1/0/10 10.1.2.3/24

PC1 / 10.1.2.101/32

PC2 / 10.1.32.102/32

园区Web服务器 / 10.1.5.110/32

4.2 实验任务配置

4.2.1 配置前提
各设备上的 IP 地址无需配置。

路由器,交换机上的动态路由协议不需要配置,学员只需要在防火墙上进行操作。

参照实验 1 和实验 3 的实验内容完成公司园区网络的安全区域,路由协议以及双机热备的部


署,本实验不再重复展示配置内容。

4.2.2 配置思路
1. 部署 NAT Server,将 Web 服务器的私网地址映射成为公网地址 10.1.40.110,为
Internet 用户提供服务。

2. 部署入侵防御功能,防御内外网的注入攻击和跨站脚本攻击。

4.2.3 配置步骤
步骤 1 配置 NAT Server

页 75
76

在 R1 上配置 NAT Server,将园区网内的 Web 服务器私网地址 10.1.5.110 映射为公网地址


10.1.40.110,对外提供服务。

# 在接口上配置 NAT Server。


[R1]interface Ethernet1/0/1
[R1-Ethernet1/0/1]nat server global 10.1.40.110 inside 10.1.5.110 description
Web_Server

在 FW1 上放行外网到 Web 服务器的流量。

# 在 FW1 上选择“策略>安全策略>安全策略”。在安全策略列表中点击“新建安全策
略”,设置参数,如下图。

步骤 2 配置入侵防御功能

为防御内外网入侵行为对 Web 服务器造成影响,开启入侵防御功能。

# 在 FW1 上选择“对象>安全配置文件>入侵防御”。新建入侵防御配置文件,如下图。

页 76
77

# 在入侵配置文件中新建“签名过滤器”。在签名过滤器中,协议为“HTTP”,威胁类型为
“注入攻击”和“跨站脚本攻击”,动作为“阻断”,如下图。

页 77
78

# 配置完成签名过滤器后,点击“确定”,如下图。

页 78
79

# 配置完成后,点击“提交”进行编译。

# 配置安全策略,当 Internet 客户访问 Web 服务器时,对流量进行入侵检查;当内网用户


访问 Web 服务器时,对流量进行入侵检查。

# 在 FW1 上选择“策略>安全策略>安全策略”,在安全策略中调用安全配置文件,如下图。

页 79
80

4.3 结果验证

4.3.1 验证入侵防御功能
# 登录 PC2,模拟外用客户,打开浏览器,访问连接 http://10.1.40.110/web/index.html,
查看能否正常访问 Web 服务器,如下图。

# 上图表明,可以正常访问 Web 服务器。

页 80
81

# 在链接中加入跨站脚本攻击的代码,测试能否正常访问 Web 服务器,如下图。

# 上图表明,PC2 无法正常访问 Web 服务器,防火墙丢弃了攻击报文。

# 登录防火墙 FW1,在防火墙上查看“监控>日志>业务日志”,入侵防御日志表明防火墙阻
断了入侵流量,如下图。

# PC1 模拟内网用户发送入侵链接,效果相同,不再赘述,请自行测试。

4.4 配置参考

4.4.1 R1 的配置
#

sysname R1

interface Eth-Trunk1

undo portswitch

description to_FW1&FW2

ip address 10.1.9.11 255.255.255.0

interface Ethernet1/0/1

ip address 10.1.40.11 255.255.255.0

nat server global 10.1.40.109 inside 10.1.5.109 description Mail_Server

页 81
82

nat server global 10.1.40.110 inside 10.1.5.110 description Web_Server

interface GigabitEthernet0/0/1

eth-trunk 1

interface GigabitEthernet0/0/2

eth-trunk 1

ospf 1

default-route-advertise always

area 0.0.0.0

network 10.1.9.0 0.0.0.255

ip route-static 0.0.0.0 0.0.0.0 10.1.40.2

return

4.4.2 FW1 的配置


#

sysname FW1

hrp enable

hrp interface GigabitEthernet1/0/5 remote 10.1.8.22

time-range working_time

period-range 09:00:00 to 17:00:00 working-day

interface GigabitEthernet1/0/0

undo shutdown

ip address 10.1.5.21 255.255.255.0

vrrp vrid 1 virtual-ip 10.1.5.254 active

页 82
83

vrrp virtual-mac enable

link-group 1

service-manage ping permit

interface GigabitEthernet1/0/1

undo shutdown

ip address 10.1.6.21 255.255.255.0

link-group 1

service-manage ping permit

interface GigabitEthernet1/0/3

undo shutdown

ip address 10.1.9.21 255.255.255.0

link-group 1

service-manage ping permit

interface GigabitEthernet1/0/5

undo shutdown

ip address 10.1.8.21 255.255.255.0

link-group 1

service-manage ping permit

firewall zone trust

set priority 85

add interface GigabitEthernet1/0/1

firewall zone dmz

set priority 50

add interface GigabitEthernet1/0/0

页 83
84

firewall zone name isp1 id 4

set priority 15

add interface GigabitEthernet1/0/3

firewall zone name dmz2 id 5

set priority 40

add interface GigabitEthernet1/0/5

ospf 1 router-id 21.21.21.21

area 0.0.0.0

network 10.1.5.0 0.0.0.255

network 10.1.6.0 0.0.0.255

network 10.1.9.0 0.0.0.255

profile type ips name "Intrusion Prevention"

signature-set name "Intrusion Prevention"

action block

os unix-like windows android ios other

target both

severity low medium high information

protocol HTTP

category XSS Injection

application all

profile type url-filter name URL_filter

category pre-defined subcategory-id 101 action block

category pre-defined subcategory-id 108 action block

category pre-defined subcategory-id 251 action block

category pre-defined subcategory-id 177 action block

category pre-defined subcategory-id 109 action block

页 84
85

category pre-defined subcategory-id 115 action block

category pre-defined subcategory-id 180 action block

category pre-defined subcategory-id 181 action block

category pre-defined subcategory-id 122 action block

category pre-defined subcategory-id 182 action block

category pre-defined subcategory-id 183 action block

category pre-defined subcategory-id 184 action block

category pre-defined subcategory-id 126 action block

category pre-defined subcategory-id 190 action block

category pre-defined subcategory-id 135 action block

category pre-defined subcategory-id 143 action block

category pre-defined subcategory-id 240 action block

category pre-defined subcategory-id 146 action block

category pre-defined subcategory-id 147 action block

category pre-defined subcategory-id 149 action block

category pre-defined subcategory-id 152 action block

category pre-defined subcategory-id 238 action block

category pre-defined subcategory-id 155 action block

category pre-defined subcategory-id 224 action block

category pre-defined subcategory-id 225 action block

category pre-defined subcategory-id 156 action block

category pre-defined subcategory-id 157 action block

category pre-defined subcategory-id 158 action block

category pre-defined subcategory-id 231 action block

category pre-defined subcategory-id 232 action block

category pre-defined subcategory-id 159 action block

category pre-defined subcategory-id 254 action block

category pre-defined subcategory-id 160 action block

category pre-defined subcategory-id 176 action block

category pre-defined subcategory-id 226 action block

页 85
86

category pre-defined subcategory-id 234 action block

category pre-defined subcategory-id 235 action block

category pre-defined subcategory-id 237 action block

category pre-defined subcategory-id 239 action block

security-policy

rule name "Employee_to_Web Server"

source-zone dmz

source-zone trust

destination-zone dmz

destination-zone trust

source-address 10.1.2.0 mask 255.255.255.0

source-address 10.1.5.110 mask 255.255.255.255

destination-address 10.1.2.0 mask 255.255.255.0

destination-address 10.1.5.110 mask 255.255.255.255

service http

service https

time-range working_time

profile ips "Intrusion Prevention"

profile url-filter URL_filter

action permit

rule name "Outbound_to_Web Server"

source-zone isp1

destination-zone dmz

destination-address 10.1.5.110 mask 255.255.255.255

service http

service https

profile ips "Intrusion Prevention"

action permit

页 86
87

return

4.4.3 FW2 的配置


#

sysname FW2

router id 22.22.22.22

hrp enable

hrp standby-device

hrp interface GigabitEthernet1/0/5 remote 10.1.8.21

time-range working_time

period-range 09:00:00 to 17:00:00 working-day

interface GigabitEthernet1/0/0

undo shutdown

ip address 10.1.5.22 255.255.255.0

vrrp vrid 1 virtual-ip 10.1.5.254 standby

vrrp virtual-mac enable

service-manage ping permit

interface GigabitEthernet1/0/1

undo shutdown

ip address 10.1.6.22 255.255.255.0

service-manage ping permit

interface GigabitEthernet1/0/3

undo shutdown

ip address 10.1.9.22 255.255.255.0

service-manage ping permit

页 87
88

interface GigabitEthernet1/0/5

undo shutdown

ip address 10.1.8.22 255.255.255.0

service-manage ping permit

firewall zone trust

set priority 85

add interface GigabitEthernet1/0/1

firewall zone dmz

set priority 50

add interface GigabitEthernet1/0/0

firewall zone name isp1 id 4

set priority 15

add interface GigabitEthernet1/0/3

firewall zone name dmz2 id 5

set priority 40

add interface GigabitEthernet1/0/5

ospf 1 router-id 22.22.22.22

area 0.0.0.0

network 10.1.5.0 0.0.0.255

network 10.1.6.0 0.0.0.255

network 10.1.9.0 0.0.0.255

profile type ips name "Intrusion Prevention"

signature-set name "Intrusion Prevention"

页 88
89

action block

os unix-like windows android ios other

target both

severity low medium high information

protocol HTTP

category XSS Injection

application all

profile type url-filter name URL_filter

category pre-defined subcategory-id 101 action block

category pre-defined subcategory-id 108 action block

category pre-defined subcategory-id 251 action block

category pre-defined subcategory-id 177 action block

category pre-defined subcategory-id 109 action block

category pre-defined subcategory-id 115 action block

category pre-defined subcategory-id 180 action block

category pre-defined subcategory-id 181 action block

category pre-defined subcategory-id 122 action block

category pre-defined subcategory-id 182 action block

category pre-defined subcategory-id 183 action block

category pre-defined subcategory-id 184 action block

category pre-defined subcategory-id 126 action block

category pre-defined subcategory-id 190 action block

category pre-defined subcategory-id 135 action block

category pre-defined subcategory-id 143 action block

category pre-defined subcategory-id 240 action block

category pre-defined subcategory-id 146 action block

category pre-defined subcategory-id 147 action block

category pre-defined subcategory-id 149 action block

category pre-defined subcategory-id 152 action block

页 89
90

category pre-defined subcategory-id 238 action block

category pre-defined subcategory-id 155 action block

category pre-defined subcategory-id 224 action block

category pre-defined subcategory-id 225 action block

category pre-defined subcategory-id 156 action block

category pre-defined subcategory-id 157 action block

category pre-defined subcategory-id 158 action block

category pre-defined subcategory-id 231 action block

category pre-defined subcategory-id 232 action block

category pre-defined subcategory-id 159 action block

category pre-defined subcategory-id 254 action block

category pre-defined subcategory-id 160 action block

category pre-defined subcategory-id 176 action block

category pre-defined subcategory-id 226 action block

category pre-defined subcategory-id 234 action block

category pre-defined subcategory-id 235 action block

category pre-defined subcategory-id 237 action block

category pre-defined subcategory-id 239 action block

security-policy

rule name "Employee_to_Web Server"

source-zone dmz

source-zone trust

destination-zone dmz

destination-zone trust

source-address 10.1.2.0 mask 255.255.255.0

source-address 10.1.5.110 mask 255.255.255.255

destination-address 10.1.2.0 mask 255.255.255.0

destination-address 10.1.5.110 mask 255.255.255.255

service http

页 90
91

service https

time-range working_time

profile ips "Intrusion Prevention"

profile url-filter URL_filter

action permit

rule name "Outbound_to_Web Server"

source-zone isp1

destination-zone dmz

destination-address 10.1.5.110 mask 255.255.255.255

service http

service https

profile ips "Intrusion Prevention"

action permit

return

页 91
92

5 DDoS 攻击与防御

5.1 实验介绍

5.1.1 关于本实验
某公司园区网络为防御外部发起 DDoS 攻击,在网络出口位置旁路部署了 AntiDDoS 设备,
该设备用于检测进入园区网络的流量,当发现有异常流量时,对流量进行清洗。清洗完成后,
再将正常流量回注到原链路。

5.1.2 实验目的
 掌握 DDoS 防御的应用场景

 掌握 AntiDDoS 系统的配置方法

5.1.3 实验组网介绍

页 92
93

图5-1 DDoS 攻击与防御实验拓扑图

5.1.4 实验规划
某公司网络如图所示,部署了服务器区,为外网客户提供服务。服务器区的服务器分为业务服
务器和管理服务器(本实验只涉及对部分业务服务器的防护):

 业务服务器主要为公司或客户提供 Web 服务,Mail 服务和 FTP 服务等;

 管理服务器主要用于管理公司网络设备和认证,如 AD 服务器,Agile Controller 服务器


等。

R1 为园区网络出口设备,为了防止外网针对园区网 Web 服务器的 DDoS 攻击,所有访问


Web 服务器的流量都要经过 AntiDDoS 设备进行检测,对攻击流量进行的防御。采用 BGP+
路由策略的方式进行引流。

ATIC 通过 Telnet 和 SNMPv2c 协议管理 AntiDDoS 设备。

运营商网络主要用于模拟公司出差员工或公司客户通过互联网访问公司服务器资源的场景。

实验设备信息

设备 端口 安全区域/IP地址

安全区域:dmz
GE1/0/0
IP地址:10.1.5.21/24

安全区域:isp1,区域优先级15
FW1 GE1/0/3
IP地址:10.1.9.21/24

安全区域:dmz2,区域优先级40
GE1/0/5
IP地址:10.1.8.21/24

安全区域:dmz
GE1/0/0
IP地址:10.1.5.22/24

安全区域:isp1,区域优先级15
FW2 GE1/0/3
IP地址:10.1.9.22/24

安全区域:dmz2,区域优先级40
GE1/0/5
IP地址:10.1.8.22/24

安全区域:untrust,区域优先级5
AntiDDoS GE1/0/0.1
IP地址:10.1.11.61/24

页 93
94

安全区域:untrust,区域优先级5
GE1/0/0.2
IP地址:10.1.13.61/24

安全区域:trust,区域优先级85
GE0/0/0
IP地址:10.1.12.61/24

成员端口:GE0/0/1与GE0/0/2
Eth-trunk1
IP地址:10.1.9.11/24

R1 Eth1/0/1 10.1.40.11/24

Eth1/0/0.1 10.1.11.11/24

Eth1/0/0.2 10.1.13.11/24

GE0/0/1 10.1.32.13/24
R3
GE0/0/2 10.1.60.13/24

ATIC管理中心 / 10.1.12.105/32

PC2 / 10.1.32.102/32

园区Web服务器 / 10.1.5.110/32

5.2 实验任务配置

5.2.1 配置前提
各设备上的 IP 地址无需配置。

路由器,交换机上的动态路由协议不需要配置,学员只需要在防火墙上进行操作。

参照实验 4 的实验内容完成公司园区网络的安全区域,路由协议,双机热备以及 NAT Server


的部署,本实验不再重复展示配置内容。

页 94
95

5.2.2 配置思路
1. 在 R1 与 AntiDDoS 设备上部署 BGP,用于引流。使用 R1 的接口 E1/0/0.1 与清洗设备的
接口 G1/0/0.1 之间建立 BGP 邻居,并将 AntiDDoS 产生的 UNR 路由引入到 BGP 中发布给
R1。

2. 在 AntiDDoS 上部署到 Web 服务器的静态路由,下一跳为 R1 的 E1/0/0.2 接口地址。

3. 在 R1 的接口 E1/0/0.2 配置策略路由,通过策略路由将接口 E1/0/0.2 收到的回注流量发


送给 FW1。

4. 在 ATIC 上部署防御策略,当 HTTP 流量超过 1000qps 时,开启源验证;并限制 TCP 的流


量为 20M/bps。

5.2.3 配置步骤
步骤 1 配置接口地址

在 R1 与 AntiDDoS 设备上配置互联地址。

# 在 R1 上配置接口地址,如下所示。
[R1] interface Ethernet1/0/0.1
[R1-Ethernet1/0/0.1] dot1q termination vid 11
[R1-Ethernet1/0/0.1] ip address 10.1.11.11 255.255.255.0
[R1-Ethernet1/0/0.1] quit
[R1] interface Ethernet1/0/0.2
[R1-Ethernet1/0/0.2] dot1q termination vid 13
[R1-Ethernet1/0/0.2] ip address 10.1.13.11 255.255.255.0

# 在 AntiDDoS 上配置接口地址,并将接口加入相应安全区域,如下所示。
[AntiDDoS1650] interface GigabitEthernet0/0/0
[AntiDDoS1650-GigabitEthernet0/0/0] ip address 10.1.12.61 255.255.255.0
[AntiDDoS1650-GigabitEthernet0/0/0] quit
[AntiDDoS1650-GigabitEthernet1/0/0] interface GigabitEthernet1/0/0.1
[AntiDDoS1650-GigabitEthernet1/0/0.1] vlan-type dot1q 11
[AntiDDoS1650-GigabitEthernet1/0/0.1] ip address 10.1.11.61 255.255.255.0
[AntiDDoS1650-GigabitEthernet1/0/0.1] service-manage ping permit
[AntiDDoS1650-GigabitEthernet1/0/0.1] service-manage snmp permit
[AntiDDoS1650-GigabitEthernet1/0/0.1] service-manage telnet permit
[AntiDDoS1650-GigabitEthernet1/0/0.1] quit
[AntiDDoS1650] interface GigabitEthernet1/0/0.2
[AntiDDoS1650-GigabitEthernet1/0/0.2] vlan-type dot1q 13
[AntiDDoS1650-GigabitEthernet1/0/0.2] ip address 10.1.13.61 255.255.255.0
[AntiDDoS1650-GigabitEthernet1/0/0.2] service-manage ping permit

页 95
96

[AntiDDoS1650-GigabitEthernet1/0/0.2] service-manage snmp permit


[AntiDDoS1650-GigabitEthernet1/0/0.2] service-manage telnet permit
[AntiDDoS1650-GigabitEthernet1/0/0.2] quit
[AntiDDoS1650-zone-trust] firewall zone untrust
[AntiDDoS1650-zone-untrust] add interface GigabitEthernet1/0/0
[AntiDDoS1650-zone-untrust] add interface GigabitEthernet1/0/0.1
[AntiDDoS1650-zone-untrust] add interface GigabitEthernet1/0/0.2

步骤 2 部署路由协议

配置在 R1 与 AntiDDoS 上配置 BGP 协议,用 BGP 路由引流。

# 配置 R1 开启 BGP 协议,AS 号为 100,使用子接口 E1/0/0.1 地址建立邻居关系。


<R1>system-view
[R1]bgp 100
[R1-bgp]peer 10.1.11.61 as-number 100

# 在 AntiDDoS 设备上开启 BGP 协议,AS 号为 100,使用子接口 GE1/0/0.1 地址建立邻居


关系,将 UNR 路由引入 BGP。
<AntiDDoS1650>sys
[AntiDDoS1650]bgp 100
[AntiDDoS1650-bgp]peer 10.1.11.11 as-number 100
[AntiDDoS1650-bgp]import-route unr

# 配置完成后,在 AntiDDoS 设备查看上邻居关系状态。


[AntiDDoS1650]display bgp peer
2019-12-15 09:54:22.520
BGP local router ID : 61.61.61.61
Local AS number : 100
Total number of peers : 1 Peers in established state : 1

Peer V AS MsgRcvd MsgSent OutQ Up/Down State PrefRcv

10.1.11.11 4 100 6 6 0 00:04:02 Established 0

# 在 AntiDDoS 设备上配置到 Web 服务器的静态路由,下一跳为 10.1.13.11。


[AntiDDoS1650]firewall ddos bgp-next-hop 10.1.13.11

步骤 3 在 R1 上部署策略路由

# 在 R1 上部署策略路由,将接口 E1/0/0.2 上收到的流量都发送给防火墙 FW1。


[R1] acl 2001
[R1-acl-basic-2001] rule 5 permit source any
[R1-acl-basic-2001] quit
[R1] traffic classifier class1

页 96
97

[R1-classifier-class1] if-match acl 2001


[R1-classifier-class1] quit
[R1] traffic behavior behavior1
[R1-behavior-behavior1] redirect ip-nexthop 10.1.9.21
[R1-behavior-behavior1] quit
[R1] traffic policy policy1
[R1-trafficpolicy-policy1] classifier class1 behavior behavior1
[R1-trafficpolicy-policy1] quit
[R1] interface Ethernet1/0/0.2
[R1-Ethernet1/0/0.2] traffic-policy policy1 inbound
[R1-Ethernet1/0/0.2] quit

步骤 4 部署 ATIC 管理 AntiDDoS

ATIC 使用 Telnet 和 SNMP 协议管理 AntiDDoS 设备。

# 在 AntiDDoS 设备上配置 Telnet。


[AntiDDoS1650] telnet server enable
[AntiDDoS1650] aaa
[AntiDDoS1650-aaa] manager-user admin
[AntiDDoS1650-aaa-manager-user-admin] service-type telnet terminal
[AntiDDoS1650-aaa-manager-user-admin] quit
[AntiDDoS1650-aaa] quit
[AntiDDoS1650] user-interface vty 0 4
[AntiDDoS1650-ui-vty0-4] protocol inbound all
[AntiDDoS1650-ui-vty0-4] quit

# 在 AntiDDoS 设备上配置 SNMP。


[AntiDDoS1650] snmp-agent
[AntiDDoS1650] snmp-agent sys-info version v2c
[AntiDDoS1650] snmp-agent community read public@123
[AntiDDoS1650] snmp-agent community write private@123

# 在 Anti-DDos 设备上连接 ATIC 的接口上允许 Telnet 和 SNMP。


[AntiDDoS1650]interface GigabitEthernet 0/0/0
[AntiDDoS1650-GigabitEthernet0/0/0]service-manage telnet permit
[AntiDDoS1650-GigabitEthernet0/0/0]service-manage snmp permit
[AntiDDoS1650-GigabitEthernet0/0/0]quit

# 在 Anti-DDos 设备清洗口上开启流量统计功能。
[AntiDDoS1650]interface GigabitEthernet 1/0/0.1
[AntiDDoS1650-GigabitEthernet1/0/0]anti-ddos flow-statistic enable

在 ATIC 上添加 AntiDDoS 设备

页 97
98

# 登录 ATIC,在 ATIC 上添加 AntiDDoS 设备,选在“防御>网络配置>设备”,点击“创建”,


设备名称是“AntiDDoS-Clean”,IP 地址:10.1.12.61,类型为 AntiDDoS,日志密码为:
Huawei@123,telnet 用户名:admin,密码:Huawei@123,SNMP 类型为 v2c,读团体字为
public@123,写团体字为 private@123,如下图。

页 98
99

步骤 5 在 AITC 上部署防御策略

# 在 ATIC 上部署防御策略,选择“防御>策略配置>防护对象”,点击“创建”,在“基本信
息”列表中创建账号和名称为“Web_Server”,行业为“电子商务”,如下图。

# 在“IP 地址”列表中添加 Web 服务器地址为 10.1.5.110/32,如下图。

页 99
100

# 在“设备”列表中添加 AntiDDoS 设备,如下图。

# 在“策略”列表中设置防御带宽为 100M,并引用预置策略模板“WEB-Server”,并创建
引流任务,部署完成后点击“部署”,如下图。

页 100
101

部署完成后,点击“Inbound 策略配置”修改预置策略配置,如下图。

# 在“防御模式”列表中的参数保持默认,如下图。

# 在“Inbound 防御策略”列表中点击“策略管理”,如下图。

页 101
102

在“配置防御策略”菜单栏中,点击“TCP”列表,限制 TCP 的流量为 20M/bps,如下图。

# 点击“HTTP”列表,当 HTTP 流量超过 1000qps 时,开启 302 源验证,如下图。

# 配置完成后,点击“确定”,如下图。

页 102
103

# 确定后,点击“部署”,等待部署状态由“部分部署”变为“部署成功”,如下图。

# 配置完成后,设置“Inbound 告警设置”,如下图。

页 103
104

# 部署完成后,在 AntiDDoS 设备上配置安全策略,允许 untrust 与 local 安全区域之间的流


量,配置如下。
[AntiDDoS1650] security-policy
[AntiDDoS1650-policy-security] rule name untrust_local
[AntiDDoS1650-policy-security-rule-untrust_local] source-zone untrust local
[AntiDDoS1650-policy-security-rule-untrust_local] destination-zone local
untrust
[AntiDDoS1650-policy-security-rule-untrust_local] action permit

5.3 结果验证

5.3.1 验证 DDoS 防御功能


# 登录 PC2,使用攻击软件模拟外网攻击者发动 TCP Flood,攻击地址为 Web 服务器的公网
地址 10.1.40.110。

# 在 ATIC 中定制首页,监控进入园区网络的流量,选择“首页>首页定制”,选择“接口流
量对比”,接口为 All,如下图。

页 104
105

当发生攻击后,在首页发现攻击信息如下。

查看 AntiDDoS-Clean 接口流量对比图,如下图,表明 TCP 流量被限制在 20M/bps,表明


防御策略生效。

5.4 配置参考

5.4.1 R1 的配置
#

sysname R1

页 105
106

acl number 2000

rule 5 permit source 10.1.2.0 0.0.0.255

acl number 2001

rule 5 permit

traffic classifier class1 operator or

if-match acl 2001

traffic behavior behavior1

redirect ip-nexthop 10.1.9.21

nat address-group 1 10.1.40.100 10.1.40.105

interface Eth-Trunk1

undo portswitch

description to_FW1&FW2

ip address 10.1.9.11 255.255.255.0

interface Ethernet1/0/0.1

dot1q termination vid 11

ip address 10.1.11.11 255.255.255.0

interface Ethernet1/0/0.2

dot1q termination vid 13

ip address 10.1.13.11 255.255.255.0

traffic-policy policy1 inbound

interface Ethernet1/0/1

ip address 10.1.40.11 255.255.255.0

nat server global 10.1.40.109 inside 10.1.5.109 description Mail_Server

页 106
107

nat server global 10.1.40.110 inside 10.1.5.110 description Web_Server

nat outbound 2000 address-group 1

bgp 100

peer 10.1.11.61 as-number 100

ipv4-family unicast

undo synchronization

peer 10.1.11.61 enable

ospf 1

default-route-advertise always

area 0.0.0.0

network 10.1.9.0 0.0.0.255

ip route-static 0.0.0.0 0.0.0.0 10.1.40.2

return

5.4.2 AntiDDoS 的配置


#

sysname AntiDDoS1650

info-center loghost 10.1.12.105

aaa

manager-user admin

password cipher Huawei@123

service-type terminal telnet

level 15

页 107
108

interface GigabitEthernet0/0/0

undo shutdown

ip address 10.1.12.61 255.255.255.0

service-manage http permit

service-manage https permit

service-manage ping permit

service-manage snmp permit

service-manage telnet permit

interface GigabitEthernet1/0/0.1

vlan-type dot1q 11

ip address 10.1.11.61 255.255.255.0

anti-ddos flow-statistic enable

service-manage ping permit

service-manage snmp permit

service-manage telnet permit

interface GigabitEthernet1/0/0.2

vlan-type dot1q 13

ip address 10.1.13.61 255.255.255.0

service-manage ping permit

service-manage snmp permit

service-manage telnet permit

firewall zone trust

set priority 85

add interface GigabitEthernet0/0/0

firewall zone untrust

set priority 5

页 108
109

add interface GigabitEthernet1/0/0

add interface GigabitEthernet1/0/0.1

add interface GigabitEthernet1/0/0.2

bgp 100

peer 10.1.11.11 as-number 100

ipv4-family unicast

undo synchronization

import-route unr

peer 10.1.11.11 enable

snmp-agent

snmp-agent local-engineid 800007DB0328B448AD878E

snmp-agent community read cipher public@123

snmp-agent community write cipher %private@123

snmp-agent sys-info version v2c v3

firewall ddos log-local-ip 10.1.12.61

firewall ddos log-server-ip 10.1.12.105

firewall ddos bgp-next-hop 10.1.13.11

firewall ddos traffic-diversion ip 10.1.5.110 255.255.255.255

anti-ddos packet-capture key


D234B2D7FFBE57BF3A6DBB816536A12D26AABB99995E4C190407CE97D3386BBB75B
E102BF2E03B6EE062ABF6E2FF7A52C252F3B260E68A0AEF83933FDDAE7F20

anti-ddos packet-capture key enable

user-interface vty 0 4

authentication-mode aaa

user privilege level 15

页 109
110

ddos-zone name web_server

zone-id 12

ip address 10.1.5.110 32

bandwidth-limit destination-ip type tcp max-speed 20

bandwidth-limit destination-ip type udp max-speed 1

bandwidth-limit destination-ip type icmp max-speed 200

bandwidth-limit destination-ip type udp-fragment max-speed 1

bandwidth-limit destination-ip type other max-speed 5

anti-ddos https-flood source-detect

anti-ddos http-flood defend alert-request 1000

anti-ddos http-flood source-detect mode redirect

anti-ddos https-flood ssl-defend

anti-ddos https-flood ssl-defend incomplete-negotiation enable

security-policy

rule name untrust_local

source-zone local

source-zone untrust

destination-zone local

destination-zone untrust

action permit

return

页 110
111

6 园区网安全组网设计

6.1 实验介绍

6.1.1 关于本实验
某企业新建总部和分部网络,为了保证网络与业务安全,在设计网络时,提出了以下要求:

 为防止设备故障造成业务访问中断,对设备进行冗余。

 为控制各部门之间相互访问,为不同的部门划分虚拟防火墙,通过虚拟防火墙实现流量控
制与设备资源充分利用。

 为保证内外网数据访问的安全,对进出公司网络的流量进行严格的控制和检查。

 为保证公司数据数据在公网上传递的安全性,采用数据加密技术。

 为防止非法人员接入公司总部的内网,对员工进行身份认证。

6.1.2 实验目的
 了解园区网络组网的安全因素

 掌握园区网组网的安全部署

页 111
112

6.1.3 实验组网介绍

图6-1 园区网安全组网实验拓扑图

6.1.4 实验规划
某公司网络如图所示,为总部网络和分支网络。

公司总部网络分为服务器区和办公区。办公区域主要是公司的员工场所;服务器区的服务器分
为业务服务器和管理服务器:

 业务服务器主要为公司或客户提供 Web 服务,Mail 服务和 FTP 服务等;

 管理服务器主要用于管理公司网络设备和认证,如 AD 服务器,Agile Controller 服务器


等。

公司的分支网络内也部署了 Web 服务器,同时公司的研发部门的员工在分支网络办公。

运营商网络主要用于模拟公司出差员工或公司客户通过互联网访问公司内部资源的场景。

实验设备信息

设备 端口 安全区域/IP地址

安全区域:dmz
GE1/0/0
FW1 IP地址:10.1.5.21/24

GE1/0/1 安全区域:trust

页 112
113

IP地址:10.1.6.21/24

安全区域:isp1,区域优先级15
GE1/0/3
IP地址:10.1.9.21/24

安全区域:dmz2,区域优先级40
GE1/0/5
IP地址:10.1.8.21/24

安全区域:dmz
GE1/0/0
IP地址:10.1.5.22/24

安全区域:trust
GE1/0/1
IP地址:10.1.6.22/24
FW2
安全区域:isp1,区域优先级15
GE1/0/3
IP地址:10.1.9.22/24

安全区域:dmz2,区域优先级40
GE1/0/5
IP地址:10.1.8.22/24

安全区域:untrust
GE1/0/0
IP地址:10.1.70.23/24

FW3 安全区域:dmz
GE1/0/1
IP地址:10.1.22.23/24

Virtual-if0 安全区域:trust

安全区域:trust
GE1/0/2
vFW1 IP地址:10.1.23.23/24

Virtual-if1 安全区域:untrust

成员端口:GE0/0/1与GE0/0/2
Eth-trunk1
R1 IP地址:10.1.9.11/24

Eth1/0/1 10.1.40.11/24

GE0/0/1 10.1.32.13/24
R3
GE0/0/2 10.1.60.13/24

页 113
114

Eth1/0/0 10.1.6.14/24
R4
Eth1/0/1 10.1.3.14/24

GE0/0/9 10.1.3.3/24
SW3
GE1/0/10 10.1.2.3/24

PC1 / 10.1.2.101/32

PC2 / 10.1.32.102/32

PC3 / 10.1.23.103/32

分支Web服务器 / 10.1.22.104/32

总部FTP服务器 / 10.1.5.108/32

总部Mail服务器 / 10.1.5.109/32

总部Web服务器 / 10.1.5.110/32

Agile Controller / 10.1.5.107/32

6.2 实验任务配置

6.2.1 配置思路
1. 部署设备冗余,为防止总部防火墙单点故障,在 FW1 与 FW2 上部署双机热备。

 FW1 为主设备,FW2 为备份设备,所有服务器的网关地址都为 VRRP 组 1 的虚地址


10.1.5.254/24;配置 Link-Group,当 FW1 上下行链路出现故障时,FW2 切换为主
设备。

2. 在分支网络中存在一个市场部,为控制市场部的流量访问与数据安全,部署虚拟防火墙,
用于市场部网络的安全防护,拓扑中 PC3 用于模拟市场部的员工。

3. 部署安全策略,对于进出公司内网的流量进行严格的控制和检查。

 总部网络的员工访问互联网时,R1 作为网络出口设备,负责进行 NAT 地址转换,配


置地址池 addre-group1,地址范围为:10.1.40.100~10.1.40.105。在防火墙 FW1
上部署安全策略,允许总部员工访问外网。

 分支机构的市场部员工访问外网时,使用 Easy-ip 进行地址转换,配置安全策略允许


分支网络市场部的员工访问外网。

页 114
115

 允许总部网络的员工和外网客户访问服务器区域,并配置内容安全对访问的流量进行
检查。

 允许分支网络市场部的员工和外网客户访问内网的 Web 服务器。

4. 部署 VPN 技术,保证总部网络和分支网络发送的数据在公网上被加密传输。

 在总部网络和分支网络的防火墙上部署 IPSec VPN,保证公司员工访问数据的加密传


输。

 在公司分支网络部署 SSL VPN,当出差员工通过公网访问分支网络的 Web 服务器


时,保证访问的安全性。

5. 部署准入控制,使用 802.1X 协议对总部办公区域的员工进行认证,认证成功后才能访问


公司服务器区域。

 SW3 作为准备控制设备对员工进行认证,Agile Controller 作为认证服务器。

6.2.2 配置步骤
步骤 1 部署设备冗余

参考实验 1 的内容,完成 IP 地址,路由和双机热备的部署,本节实验不再重复展示。

步骤 2 部署虚拟防火墙

在 FW3 上部署虚拟防火墙 vFW1,并将 GE1/0/2 接口加入到虚拟防火墙,用于防护分支网络


中的市场部。

# 登录 FW3,选择“系统>虚拟系统>虚拟系统”,启用防火墙的虚拟系统功能,选择“启
用”后,点击“应用”,如下图。

# 在出现的“虚拟系统列表”中,选择“新建”,创建虚拟系统 vfw1,资源类选择“r0”,如
下图。

页 115
116

# 在“接口分配及公共接口设定”列表中,将 GE1/0/2 加入虚拟系统,如下图。

# 登录 FW3,在接口列表中编辑 GE1/0/2,将接口加入虚拟防火墙的 trust 区域,并配置地


址,如下图。

页 116
117

# 在 FW3 上将虚接口 virtual-if0 加入根墙的 trust 区域,如下图。

# 在 FW3 上将虚接口 virtual-if1 加入虚拟防火墙的 untrust 区域,如下图。

# 在 FW3 上切换到虚拟防火墙 vFW1 视图中,配置虚拟防火墙,如下图。

# 在虚拟防火墙 vFW1 中配置默认路由,下一跳为根墙,选择“网络>路由>静态路由”,在


静态路由列表中点击“新建”,如下图。

页 117
118

在 vFW1 中配置安全策略,放行虚拟防火墙中 trust 与 untrsut 的流量。

页 118
119

# 配置完成后,在 FW3 上切换到根墙视图中,如下图。

# 配置到达市场部网络的静态路由,下一跳为虚拟防火墙 vFW1,选择“网络>路由>静态路
由”,在静态路由列表中点击“新建”,如下图。

步骤 3 部署安全策略

总部网络的员工访问互联网时,在 R1 上进行 NAT 地址转换,地址池范围为:


10.1.40.100~10.1.40.105。

页 119
120

# 在 R1 上部署 NAT,配置如下。
[R1] acl number 2000
[R1-acl-basic-2000] rule 5 permit source 10.1.2.0 0.0.0.255
[R1-acl-basic-2000] quit
[R1] nat address-group 1 10.1.40.100 10.1.40.105
[R1] interface Ethernet1/0/1
[R1-Ethernet1/0/1] nat outbound 2000 address-group 1
[R1-Ethernet1/0/1] quit

# 在 FW1 上配置安全策略,放行办公区域访问 Internet 的流量。选择“策略>安全策略>安


全策略”,新建安全策略,如下图。

分支网络的市场部员工访问外网时,使用 Easy-ip 进行地址转换,配置安全策略允许分支网络


员工访问外网。

# 在 FW3 上部署 Easy-ip,对公司分支网络的市场部员工地址进行转换,选择“策略>NAT


策略>NAT 策略”,在 NAT 策略列表中单击“新建”,如下图。

页 120
121

# 在 FW3 上配置安全策略,放行市场部员工访问 Internet 的流量。选择“策略>安全策略>


安全策略”,新建安全策略,如下图。

参考实验 1,3,4 内容,在防火墙 FW1 上开启内容安全功能,检查总部园区网络办公区域员工


访问服务器的流量,以及外网客户访问服务器的流量。

参考实验 2 的内容,配置 NAT Server,并在 FW3 上放行外网客户访问分支网络 Web 服务器


的流量。

# 在 FW3 上配置安全策略,放行分支网络市场部员工访问 Web 服务器的流量。选择“策


略>安全策略>安全策略”,新建安全策略,如下图。

页 121
122

步骤 4 配置 VPN

部署 IPSec VPN,当总部员工与分支市场部员工进行互访时,对穿越公网的流量进行加密传
输。

# 在总部网络的 FW1 与 FW2 上部署 IPSec VPN。因为 R1 作为总部园区网络的出口设备,


需要将 FW1 与 FW2 出口的私网地址进行转换才能与分支建立 IPSec VPN 隧道。在 R1 上部
署 Easy-ip,将防火墙上 GE1/0/3 出口地址转换为 R1 的 E1/0/1 地址,配置如下。
[R1] acl 2002
[R1-acl-basic-2002] rule 5 permit source 10.1.9.0 0.0.0.255
[R1-acl-basic-2002] quit
[R1]interface Ethernet1/0/1

页 122
123

[R1-Ethernet1/0/1]nat outbound 2002

在 FW1 上配置安全策略。

# 放行 FW1 出接口 GE1/0/3 到 FW3 出接口 10.1.70.23 的流量,用于建立 IPSec 隧道。选


择“策略>安全策略>安全策略”,新建安全策略,如下图。

# 放行 FW2 出接口 GE1/0/3 到 FW3 出接口 10.1.70.23 的流量,用于建立 IPSec 隧道。新


建安全策略,如下图。

# 放行总部办公区域与分支市场部员工互访的流量。选择“策略>安全策略>安全策略”,新
建安全策略,如下图。

页 123
124

# 在 FW1 上配置 IPSec VPN,使用出接口 GE1/0/3 与对端 FW3 建立 IPSec VPN 隧道,预
共享秘钥为 Huawei@123。选择“网络>IPSec>IPSec”,新建 IPSec 策略,如下图。

页 124
125

在 FW3 上配置安全策略。

# 放行 FW3 出接口 GE1/0/0 到 R1 出接口的流量,用于建立 IPSec 隧道。选择“策略>安全


策略>安全策略”,新建安全策略,如下图

页 125
126

# 放行分支市场部员工与总部办公区域互访的流量。选择“策略>安全策略>安全策略”,新
建安全策略,如下图。

# 在 FW1 上配置 IPSec VPN,使用模板与对端建立 IPSec 隧道,出接口为 GE1/0/0,预共


享秘钥为 Huawei@123。选择“网络>IPSec>IPSec”,新建 IPSec 策略,如下图。

页 126
127

# 部署完成后,在 FW1 上查看 IPSec 隧道建立状态,如下图,表明隧道建立成功。

部署 SSL VPN,当出差员工访问分支内网的 Web 服务器时,保证访问的数据安全。

# 在 FW3 上开启 SSL VPN,网关名称为“vGW”,类型为独占,使用 GE1/0/0 作为虚拟网


关的接口,最大用户数与最大并发用户数都为 100。选择“网络>SSL VPN>SSL VPN”,在
SSL VPN 列表中单击“新建”,如下图。

页 127
128

# 点击“下一步”,SSL 配置中选中所有 SSL 的版本,如下图。

# 点击“下一步”,在业务功能选择列表中,选择“Web 代理”,用于使用 SSL VPN 加密访


问 Web 服务的数据,如下图。

页 128
129

# 点击“下一步”,在 web 代理列表中,在 web 代理资源列表中点击“新建”,如下图。

# 点击“下一步”,在“角色授权/用户”列表中,新建用户组为“Business_travel”,如下
图。

页 129
130

# 点击“确定”,如下图。

# 同样方式,为出差员工新建账号,用户名为 employee1,密码为 Huawei@123,如下


图。

页 130
131

# 点击“确定”,如下图。

# 配置完成后,配置角色授权,允许出差员工使用 Web 代理功能。在在“角色授权/用户”


列表中,选择“角色授权列表”中的新建,如下图。

页 131
132

# 为出差员工新建“Business_travel”的角色,关联用户组 business_travel,并在资源授权
列表中选择“web 代理”功能,如下图。

# 配置完成后,如下图,点击“完成”。

页 132
133

# 配置安全策略,放行出差员工访问 SSL VPN 虚拟网关的流量。选择“策略>安全策略>安


全策略”,新建安全策略,如下图。

# 配置安全策略,放行 SSL 虚拟网关到 Web 服务器的流量,如下图。

页 133
134

步骤 5 配置准入控制

在公司总部园区网中,SW3 作为准入控制设备,Agile Controller 作为认证服务器,对办公


区域的员工进行认证,认证成功后才允许访问服务器区域。

# 在 SW3 上配置认证服务器模板,指定 RADUIS 服务器为 Agile Controller,认证计费秘钥


和授权秘钥都为 Huawei@123,配置如下。
[SW3] radius-server template radius
[SW3-radius-radius] radius-server authentication 10.1.5.107 1812
[SW3-radius-radius] radius-server accounting 10.1.5.107 1813
[SW3-radius-radius] radius-server shared-key cipher Huawei@123
[SW3-radius-radius] quit
[SW3] radius-server authorization 10.1.5.107 shared-key cipher Huawei@123

# 配置 AAA 认证与计费模板,认证协议为 RADUIS;在默认域中调用 AAA 认证模板,计费


模板和认证服务器模板。
[SW3] aaa
[SW3-aaa] authentication-scheme radius
[SW3-aaa-authen-radius] authentication-mode radius
[SW3-aaa-authen-radius] quit
[SW3-aaa] accounting-scheme radius
[SW3-aaa-accounting-radius] accounting-mode radius
[SW3-aaa-accounting-radius] quit
[SW3-aaa] domain default
[SW3-aaa-domain-default] radius-server radius
[SW3-aaa-domain-default] authentication-scheme radius

页 134
135

[SW3-aaa-domain-default] accounting-scheme radius


[SW3-aaa-domain-default] quit
[SW3-aaa] quit

# 交换机上不采用统一模式,配置完以下命令后,交换机会重启。
[SW3] undo authentication unified-mode

# 开启 802.1X 协议,并使用 EAP 协议进行封装,放行办公区域访问 Agile Controller 认证


服务的认证流量。
[SW3] dot1x enable
[SW3] dot1x authentication-method eap
[SW3] dot1x free-ip 10.1.5.107 32

# 在连接用户区域的接口 GE0/0/10 上开启 802.1X 认证。


[SW3] interface GigabitEthernet 0/0/10
[SW3-GigabitEthernet0/0/10] dot1x enable
[SW3-GigabitEthernet0/0/10] dot1x domain default
[SW3-GigabitEthernet0/0/10] dot1x authentication-method eap

在 FW1 上配置安全策略。

# SW3 与 Agile Controller 之间使用 RADIUS 协议交互认证信息,所以在 FW1 上放行 SW1


接口 GE1/0/9 到 Agile Controller 的流量,选择“策略>安全策略>安全策略”,新建安全策
略,配置如下图。

# 放行办公区域到 Agile Controller 的认证流量,如下图。

页 135
136

# 可参考实验 1,3,4 中部署的安全策略,在 FW1 上放行办公区域访问服务器区域的流量,配


置如下。

在 Agile Controller 上配置认证账号。

# 登录 Agile Controller,选择“资源>用户>用户管理”,在 ROOT 用户组下,创建


Employee 用户组,在 Employee 用户组中添加用户账号 employee1,密码为
Huawei@123,不允许修改密码,配置如下。

页 136
137

页 137
138

# 在 Agile Controller 上添加准入控制设备,选择选择“资源>设备>设备管理”,添加准入


控制设备,名称为 SW3,IP 地址为 10.1.3.3,认证计费秘钥与授权秘钥都为
Huawei@123,配置如下。

页 138
139

配置认证授权规则,当用户认证成功后,允许用户访问公司内网的所有资源,所以授权结果可
以使用默认的“允许接入”。

# 选择“策略>认证授权>认证规则”,新建认证规则,如下图。

页 139
140

页 140
141

# 选择“策略>认证授权>授权规则”,新建授权规则,调用默认的“允许接入”的授权结
果,如下图。

页 141
142

页 142
143

6.3 结果验证

6.3.1 验证双机热备功能
# # 在 FW1 和 FW2 上选择“系统>高可靠性>双机热备”,检查防火墙状态,如下图。

页 143
144

# 将 FW1 的 G1/0/3 接口禁用,模拟 FW1 连接 Internet 的出口故障,如下图。

# 再次查看 FW1 和 FW2 双机热备的状态,表明发生了状态切换,如下图。

页 144
145

# 验证完成后,将 FW1 上的 G1/0/3 接口恢复。

6.3.2 验证身份认证
# 在 SW3 上测试交换机与 Agile Controller 之间的认证交互过程,如下。
<SW3> test-aaa employee1 Huawei@123 radius-template radius pap
Info: Account test succeed.

# 表明交换机与 Agile Controller 之间认证成功。

# 登录 PC1,使用 AnyOffice 软件输入用户名和密码,认证成功,提示如下。

6.3.3 验证安全策略
# 登录 PC1,测试到 PC2 的可达性,模拟总部园区网络中的办公区域员工访问 Internet,如
下图。

# 上图表明内网用户可以通过 NAT 转换后访问 Internet.

# 登录 PC3,测试到 PC2 的可达性,模拟公司分支网络中的市场部员工访问 Internet,如下


图,表明市场部员工能够正常访问 Internet。

页 145
146

# 在 PC3 上打开浏览器,访问 Web 服务器的连接 http://10.1.22.104/web/index.html,如


下图,表明市场部员工可以访问 Web 服务器。

6.3.4 验证 VPN 配置
# 登录 PC1,测试到 PC3 的可达性,模拟总部办公区域员工通过 IPSec VPN 访问分支网络
的员工,如下图。

# 表明总部和分之网络可以通过 IPSec VPN 隧道互访。

页 146
147

# 登录 PC2,模拟出差员工访问 Web 服务器,在 IE 浏览器中输入 SSL VPN 的链接:


https://10.1.70.23:443,如下图。

# 输入出差员工的用户名密码,查看可用资源,如下图。

点击 Web Server 的连接,访问 Web 服务器,如下图,表明可以通过 SSL VPN 访问 Web


Server。

页 147
148

6.4 配置参考

6.4.1 FW1 的配置


#

sysname FW1

hrp enable

hrp interface GigabitEthernet1/0/5 remote 10.1.8.22

time-range working_time

period-range 09:00:00 to 17:00:00 working-day

acl number 3000

rule 5 permit ip source 10.1.2.0 0.0.0.255 destination 10.1.23.0 0.0.0.255

ipsec proposal prop15122310405

encapsulation-mode auto

esp authentication-algorithm sha2-256

页 148
149

esp encryption-algorithm aes-256

ike proposal 1

encryption-algorithm aes-256

dh group14

authentication-algorithm sha2-256

authentication-method pre-share

integrity-algorithm hmac-sha2-256

prf hmac-sha2-256

ike peer ike151223104057

exchange-mode auto

pre-shared-key Huawei@123

ike-proposal 1

remote-id-type none

dpd type periodic

remote-address 10.1.70.23

ipsec policy ipsec1512231040 1 isakmp

security acl 3000

ike-peer ike151223104057

proposal prop15122310405

tunnel local applied-interface

alias HQ_to_Branch

sa trigger-mode auto

sa duration traffic-based 5242880

sa duration time-based 3600

interface GigabitEthernet1/0/0

undo shutdown

页 149
150

ip address 10.1.5.21 255.255.255.0

vrrp vrid 1 virtual-ip 10.1.5.254 active

vrrp virtual-mac enable

link-group 1

service-manage ping permit

interface GigabitEthernet1/0/1

undo shutdown

ip address 10.1.6.21 255.255.255.0

link-group 1

service-manage ping permit

interface GigabitEthernet1/0/3

undo shutdown

ip address 10.1.9.21 255.255.255.0

link-group 1

service-manage ping permit

ipsec policy ipsec1512231040

interface GigabitEthernet1/0/5

undo shutdown

ip address 10.1.8.21 255.255.255.0

link-group 1

service-manage ping permit

firewall zone trust

set priority 85

add interface GigabitEthernet1/0/1

firewall zone dmz

页 150
151

set priority 50

add interface GigabitEthernet1/0/0

firewall zone name isp1 id 4

set priority 15

add interface GigabitEthernet1/0/3

firewall zone name dmz2 id 5

set priority 40

add interface GigabitEthernet1/0/5

ospf 1 router-id 21.21.21.21

area 0.0.0.0

network 10.1.5.0 0.0.0.255

network 10.1.6.0 0.0.0.255

network 10.1.9.0 0.0.0.255

network 10.1.10.0 0.0.0.255

profile type ips name "Intrusion Prevention"

signature-set name "Intrusion Prevention"

action block

os unix-like windows android ios other

target both

severity low medium high information

protocol HTTP

category XSS Injection

application all

profile type url-filter name URL_filter

category pre-defined subcategory-id 101 action block

页 151
152

category pre-defined subcategory-id 108 action block

category pre-defined subcategory-id 251 action block

category pre-defined subcategory-id 177 action block

category pre-defined subcategory-id 109 action block

category pre-defined subcategory-id 115 action block

category pre-defined subcategory-id 180 action block

category pre-defined subcategory-id 181 action block

category pre-defined subcategory-id 122 action block

category pre-defined subcategory-id 182 action block

category pre-defined subcategory-id 183 action block

category pre-defined subcategory-id 184 action block

category pre-defined subcategory-id 126 action block

category pre-defined subcategory-id 190 action block

category pre-defined subcategory-id 135 action block

category pre-defined subcategory-id 143 action block

category pre-defined subcategory-id 240 action block

category pre-defined subcategory-id 146 action block

category pre-defined subcategory-id 147 action block

category pre-defined subcategory-id 149 action block

category pre-defined subcategory-id 152 action block

category pre-defined subcategory-id 238 action block

category pre-defined subcategory-id 155 action block

category pre-defined subcategory-id 224 action block

category pre-defined subcategory-id 225 action block

category pre-defined subcategory-id 156 action block

category pre-defined subcategory-id 157 action block

category pre-defined subcategory-id 158 action block

category pre-defined subcategory-id 231 action block

category pre-defined subcategory-id 232 action block

category pre-defined subcategory-id 159 action block

页 152
153

category pre-defined subcategory-id 254 action block

category pre-defined subcategory-id 160 action block

category pre-defined subcategory-id 176 action block

category pre-defined subcategory-id 226 action block

category pre-defined subcategory-id 234 action block

category pre-defined subcategory-id 235 action block

category pre-defined subcategory-id 237 action block

category pre-defined subcategory-id 239 action block

profile type av name AntiVirus

undo http-detect

undo ftp-detect

smtp-detect action delete-attachment

pop3-detect action delete-attachment

imap-detect direction both action delete-attachment

undo nfs-detect

undo smb-detect

profile type app-control name Behavior_control

http-control web-browse action deny

http-control proxy action deny

http-control post action deny

http-control file direction upload action deny

http-control file direction download action deny

ftp-control file delete action deny

ftp-control file direction upload action deny

ftp-control file direction download alert-size 50000

ftp-control file direction download block-size 50001

im-control qq action deny

页 153
154

keyword-group name key_words

user-defined-keyword name password

expression match-mode text password

undo case-sensitive enable

user-defined-keyword name secret

expression match-mode text secret

undo case-sensitive enable

profile type data-filter name Content_filter

rule name Content_filter

keyword-group name key_words

file-type all

application type SMTP POP3 IMAP

action block

security-policy

rule name Office_outbound

source-zone trust

destination-zone isp1

source-address 10.1.2.0 mask 255.255.255.0

action permit

rule name "Outbound_to_Mail Server"

source-zone isp1

destination-zone dmz

destination-address 10.1.5.109 mask 255.255.255.255

profile av AntiVirus

action permit

rule name "Employee_to_Mail Server"

source-zone dmz

source-zone trust

页 154
155

destination-zone dmz

destination-zone trust

source-address 10.1.2.0 mask 255.255.255.0

source-address 10.1.5.109 mask 255.255.255.255

destination-address 10.1.2.0 mask 255.255.255.0

destination-address 10.1.5.109 mask 255.255.255.255

profile av AntiVirus

profile data-filter Content_filter

action permit

rule name "Employee_to_FTP Server"

source-zone dmz

source-zone trust

destination-zone dmz

destination-zone trust

source-address 10.1.2.0 mask 255.255.255.0

source-address 10.1.5.108 mask 255.255.255.255

destination-address 10.1.2.0 mask 255.255.255.0

destination-address 10.1.5.108 mask 255.255.255.255

service ftp

profile app-control Behavior_control

action permit

rule name "Employee_to_Web Server"

source-zone dmz

source-zone trust

destination-zone dmz

destination-zone trust

source-address 10.1.2.0 mask 255.255.255.0

source-address 10.1.5.110 mask 255.255.255.255

destination-address 10.1.2.0 mask 255.255.255.0

destination-address 10.1.5.110 mask 255.255.255.255

页 155
156

service http

service https

time-range working_time

profile ips "Intrusion Prevention"

profile url-filter URL_filter

action permit

rule name "Outbound_to_Web Server"

source-zone isp1

destination-zone dmz

destination-address 10.1.5.110 mask 255.255.255.255

service http

service https

profile ips "Intrusion Prevention"

action permit

rule name IPSec_tunnel_1

source-zone isp1

source-zone local

destination-zone isp1

destination-zone local

source-address 10.1.70.23 mask 255.255.255.255

source-address 10.1.9.21 mask 255.255.255.255

destination-address 10.1.70.23 mask 255.255.255.255

destination-address 10.1.9.11 mask 255.255.255.255

action permit

rule name IPSec_tunnel_2

source-zone isp1

source-zone local

destination-zone isp1

destination-zone local

source-address 10.1.70.23 mask 255.255.255.255

页 156
157

source-address 10.1.9.22 mask 255.255.255.255

destination-address 10.1.70.23 mask 255.255.255.255

destination-address 10.1.9.22 mask 255.255.255.255

action permit

rule name IPSec_data

source-zone isp1

source-zone trust

destination-zone isp1

destination-zone trust

source-address 10.1.2.0 mask 255.255.255.0

source-address 10.1.23.0 mask 255.255.255.0

destination-address 10.1.2.0 mask 255.255.255.0

destination-address 10.1.23.0 mask 255.255.255.0

action permit

rule name "Agile Controller_SW3"

source-zone dmz

source-zone trust

destination-zone dmz

destination-zone trust

source-address 10.1.3.3 mask 255.255.255.255

source-address 10.1.5.107 mask 255.255.255.255

destination-address 10.1.3.3 mask 255.255.255.255

destination-address 10.1.5.107 mask 255.255.255.255

action permit

rule name "Employee_Agile Controller"

source-zone dmz

source-zone trust

destination-zone dmz

destination-zone trust

source-address 10.1.2.0 mask 255.255.255.0

页 157
158

source-address 10.1.5.107 mask 255.255.255.255

destination-address 10.1.2.0 mask 255.255.255.0

destination-address 10.1.5.107 mask 255.255.255.255

action permit

return

6.4.2 FW2 的配置


#

sysname FW2

hrp enable

hrp standby-device

hrp interface GigabitEthernet1/0/5 remote 10.1.8.21

time-range working_time

period-range 09:00:00 to 17:00:00 working-day

acl number 3000

rule 5 permit ip source 10.1.2.0 0.0.0.255 destination 10.1.23.0 0.0.0.255

ipsec proposal prop15122310405

encapsulation-mode auto

esp authentication-algorithm sha2-256

esp encryption-algorithm aes-256

ike proposal 1

encryption-algorithm aes-256

dh group14

authentication-algorithm sha2-256

authentication-method pre-share

页 158
159

integrity-algorithm hmac-sha2-256

prf hmac-sha2-256

ike peer ike151223104057

exchange-mode auto

pre-shared-key Huawei@123

ike-proposal 1

remote-id-type none

dpd type periodic

remote-address 10.1.70.23

ipsec policy ipsec1512231040 1 isakmp

security acl 3000

ike-peer ike151223104057

proposal prop15122310405

tunnel local applied-interface

alias HQ_to_Branch

sa trigger-mode auto

sa duration traffic-based 5242880

sa duration time-based 3600

interface GigabitEthernet1/0/0

undo shutdown

ip address 10.1.5.22 255.255.255.0

vrrp vrid 1 virtual-ip 10.1.5.254 standby

vrrp virtual-mac enable

service-manage ping permit

interface GigabitEthernet1/0/1

undo shutdown

页 159
160

ip address 10.1.6.22 255.255.255.0

service-manage ping permit

interface GigabitEthernet1/0/3

undo shutdown

ip address 10.1.9.22 255.255.255.0

service-manage ping permit

ipsec policy ipsec1512231040

interface GigabitEthernet1/0/5

undo shutdown

ip address 10.1.8.22 255.255.255.0

service-manage ping permit

firewall zone trust

set priority 85

add interface GigabitEthernet1/0/1

firewall zone dmz

set priority 50

add interface GigabitEthernet1/0/0

firewall zone name isp1 id 4

set priority 15

add interface GigabitEthernet1/0/3

firewall zone name dmz2 id 5

set priority 40

add interface GigabitEthernet1/0/5

页 160
161

ospf 1 router-id 22.22.22.22

area 0.0.0.0

network 10.1.5.0 0.0.0.255

network 10.1.6.0 0.0.0.255

network 10.1.9.0 0.0.0.255

network 10.1.10.0 0.0.0.255

profile type ips name "Intrusion Prevention"

signature-set name "Intrusion Prevention"

action block

os unix-like windows android ios other

target both

severity low medium high information

protocol HTTP

category XSS Injection

application all

profile type url-filter name URL_filter

category pre-defined subcategory-id 101 action block

category pre-defined subcategory-id 108 action block

category pre-defined subcategory-id 251 action block

category pre-defined subcategory-id 177 action block

category pre-defined subcategory-id 109 action block

category pre-defined subcategory-id 115 action block

category pre-defined subcategory-id 180 action block

category pre-defined subcategory-id 181 action block

category pre-defined subcategory-id 122 action block

category pre-defined subcategory-id 182 action block

category pre-defined subcategory-id 183 action block

category pre-defined subcategory-id 184 action block

页 161
162

category pre-defined subcategory-id 126 action block

category pre-defined subcategory-id 190 action block

category pre-defined subcategory-id 135 action block

category pre-defined subcategory-id 143 action block

category pre-defined subcategory-id 240 action block

category pre-defined subcategory-id 146 action block

category pre-defined subcategory-id 147 action block

category pre-defined subcategory-id 149 action block

category pre-defined subcategory-id 152 action block

category pre-defined subcategory-id 238 action block

category pre-defined subcategory-id 155 action block

category pre-defined subcategory-id 224 action block

category pre-defined subcategory-id 225 action block

category pre-defined subcategory-id 156 action block

category pre-defined subcategory-id 157 action block

category pre-defined subcategory-id 158 action block

category pre-defined subcategory-id 231 action block

category pre-defined subcategory-id 232 action block

category pre-defined subcategory-id 159 action block

category pre-defined subcategory-id 254 action block

category pre-defined subcategory-id 160 action block

category pre-defined subcategory-id 176 action block

category pre-defined subcategory-id 226 action block

category pre-defined subcategory-id 234 action block

category pre-defined subcategory-id 235 action block

category pre-defined subcategory-id 237 action block

category pre-defined subcategory-id 239 action block

profile type av name AntiVirus

undo http-detect

页 162
163

undo ftp-detect

smtp-detect action delete-attachment

pop3-detect action delete-attachment

imap-detect direction both action delete-attachment

undo nfs-detect

undo smb-detect

profile type app-control name Behavior_control

http-control web-browse action deny

http-control proxy action deny

http-control post action deny

http-control file direction upload action deny

http-control file direction download action deny

ftp-control file delete action deny

ftp-control file direction upload action deny

ftp-control file direction download alert-size 50000

ftp-control file direction download block-size 50001

im-control qq action deny

keyword-group name key_words

user-defined-keyword name password

expression match-mode text password

undo case-sensitive enable

user-defined-keyword name secret

expression match-mode text secret

undo case-sensitive enable

profile type data-filter name Content_filter

rule name Content_filter

keyword-group name key_words

页 163
164

file-type all

application type SMTP POP3 IMAP

action block

security-policy

rule name Office_outbound

source-zone trust

destination-zone isp1

source-address 10.1.2.0 mask 255.255.255.0

action permit

rule name "Outbound_to_Mail Server"

source-zone isp1

destination-zone dmz

destination-address 10.1.5.109 mask 255.255.255.255

profile av AntiVirus

action permit

rule name "Employee_to_Mail Server"

source-zone dmz

source-zone trust

destination-zone dmz

destination-zone trust

source-address 10.1.2.0 mask 255.255.255.0

source-address 10.1.5.109 mask 255.255.255.255

destination-address 10.1.2.0 mask 255.255.255.0

destination-address 10.1.5.109 mask 255.255.255.255

profile av AntiVirus

profile data-filter Content_filter

action permit

rule name "Employee_to_FTP Server"

source-zone dmz

页 164
165

source-zone trust

destination-zone dmz

destination-zone trust

source-address 10.1.2.0 mask 255.255.255.0

source-address 10.1.5.108 mask 255.255.255.255

destination-address 10.1.2.0 mask 255.255.255.0

destination-address 10.1.5.108 mask 255.255.255.255

service ftp

profile app-control Behavior_control

action permit

rule name "Employee_to_Web Server"

source-zone dmz

source-zone trust

destination-zone dmz

destination-zone trust

source-address 10.1.2.0 mask 255.255.255.0

source-address 10.1.5.110 mask 255.255.255.255

destination-address 10.1.2.0 mask 255.255.255.0

destination-address 10.1.5.110 mask 255.255.255.255

service http

service https

time-range working_time

profile ips "Intrusion Prevention"

profile url-filter URL_filter

action permit

rule name "Outbound_to_Web Server"

source-zone isp1

destination-zone dmz

destination-address 10.1.5.110 mask 255.255.255.255

service http

页 165
166

service https

profile ips "Intrusion Prevention"

action permit

rule name IPSec_tunnel_1

source-zone isp1

source-zone local

destination-zone isp1

destination-zone local

source-address 10.1.70.23 mask 255.255.255.255

source-address 10.1.9.21 mask 255.255.255.255

destination-address 10.1.70.23 mask 255.255.255.255

destination-address 10.1.9.11 mask 255.255.255.255

action permit

rule name IPSec_tunnel_2

source-zone isp1

source-zone local

destination-zone isp1

destination-zone local

source-address 10.1.70.23 mask 255.255.255.255

source-address 10.1.9.22 mask 255.255.255.255

destination-address 10.1.70.23 mask 255.255.255.255

destination-address 10.1.9.22 mask 255.255.255.255

action permit

rule name IPSec_data

source-zone isp1

source-zone trust

destination-zone isp1

destination-zone trust

source-address 10.1.2.0 mask 255.255.255.0

source-address 10.1.23.0 mask 255.255.255.0

页 166
167

destination-address 10.1.2.0 mask 255.255.255.0

destination-address 10.1.23.0 mask 255.255.255.0

action permit

rule name "Agile Controller_SW3"

source-zone dmz

source-zone trust

destination-zone dmz

destination-zone trust

source-address 10.1.3.3 mask 255.255.255.255

source-address 10.1.5.107 mask 255.255.255.255

destination-address 10.1.3.3 mask 255.255.255.255

destination-address 10.1.5.107 mask 255.255.255.255

action permit

rule name "Employee_Agile Controller"

source-zone dmz

source-zone trust

destination-zone dmz

destination-zone trust

source-address 10.1.2.0 mask 255.255.255.0

source-address 10.1.5.107 mask 255.255.255.255

destination-address 10.1.2.0 mask 255.255.255.0

destination-address 10.1.5.107 mask 255.255.255.255

action permit

return

6.4.3 FW3 的配置


#

sysname FW3

vsys enable

页 167
168

resource-class r0

vsys name vfw1 1

assign interface GigabitEthernet1/0/2

assign resource-class r0

acl number 3000

rule 5 permit ip source 10.1.23.0 0.0.0.255 destination 10.1.2.0 0.0.0.255

ipsec proposal prop15122329408

encapsulation-mode auto

esp authentication-algorithm sha2-256

esp encryption-algorithm aes-256

ike proposal default

encryption-algorithm aes-256 aes-192 aes-128

dh group14

authentication-algorithm sha2-512 sha2-384 sha2-256

authentication-method pre-share

integrity-algorithm hmac-sha2-256

prf hmac-sha2-256

ike proposal 1

encryption-algorithm aes-256

dh group14

authentication-algorithm sha2-256

authentication-method pre-share

integrity-algorithm hmac-sha2-256

prf hmac-sha2-256

ike peer ike151223294082

页 168
169

exchange-mode auto

pre-shared-key Huawei@123

ike-proposal 1

remote-id-type none

dpd type periodic

ipsec policy-template tpl151223294082 1

security acl 3000

ike-peer ike151223294082

proposal prop15122329408

tunnel local 10.1.70.23

alias Branch_to_HQ-10

sa duration traffic-based 5242880

sa duration time-based 3600

scenario point-to-point

ipsec policy ipsec1512232940 10000 isakmp template tpl151223294082

interface GigabitEthernet1/0/0

undo shutdown

ip address 10.1.70.23 255.255.255.0

service-manage ping permit

ipsec policy ipsec1512232940

interface GigabitEthernet1/0/1

undo shutdown

ip address 10.1.22.23 255.255.255.0

service-manage ping permit

页 169
170

interface GigabitEthernet1/0/2

undo shutdown

ip binding vpn-instance vfw1

ip address 10.1.23.23 255.255.255.0

service-manage ping permit

firewall zone trust

set priority 85

add interface GigabitEthernet0/0/0

add interface Virtual-if0

firewall zone untrust

set priority 5

add interface GigabitEthernet1/0/0

firewall zone dmz

set priority 50

add interface GigabitEthernet1/0/1

ip route-static 0.0.0.0 0.0.0.0 10.1.70.2

ip route-static 10.1.23.0 255.255.255.0 vpn-instance vfw1

undo ssh server compatible-ssh1x enable

ssh authentication-type default password

ssh server cipher aes256_ctr aes128_ctr

ssh server hmac sha2_256

v-gateway public ssl version tlsv11 tlsv12

v-gateway public ssl ciphersuit custom aes256-sha non-des-cbc3-sha aes128-sha

v-gateway vgw interface GigabitEthernet1/0/0 private

页 170
171

v-gateway vgw alias vGW

nat server Web_Server zone untrust global 10.1.70.104 inside 10.1.22.104 no-
reverse unr-route

#****BEGIN***vgw**1****#

v-gateway vgw

basic

ssl version tlsv10 tlsv11 tlsv12

ssl timeout 5

ssl lifecycle 1440

ssl ciphersuit custom aes256-sha non-des-cbc3-sha aes128-sha

service

web-proxy enable

web-proxy web-link enable

web-proxy link-resource Web^pServer http://10.1.22.104/web/index.html show-


link

network-extension mode split

security

policy-default-action permit vt-src-ip

certification cert-anonymous cert-field user-filter subject cn group-filter subject cn

certification cert-anonymous filter-policy permit-all

certification cert-challenge cert-field user-filter subject cn

certification user-cert-filter key-usage any

undo public-user enable

hostchecker

cachecleaner

vpndb

group /default

group /default/business_travel

role

页 171
172

role default

role default condition all

role Business_travel

role Business_travel condition all

role Business_travel web-proxy enable

role Business_travel web-proxy resource Web^pServer

#****END****#

security-policy

rule name Employee_outbound

source-zone trust

destination-zone untrust

source-address 10.1.23.0 mask 255.255.255.0

action permit

rule name "Outbound_to_Web Server"

source-zone untrust

destination-zone dmz

destination-address 10.1.22.104 mask 255.255.255.255

action permit

rule name IPSec_tunnel

source-zone local

source-zone untrust

destination-zone local

destination-zone untrust

source-address 10.1.40.11 mask 255.255.255.255

source-address 10.1.70.23 mask 255.255.255.255

destination-address 10.1.40.11 mask 255.255.255.255

destination-address 10.1.70.23 mask 255.255.255.255

action permit

rule name IPSec_data

页 172
173

source-zone trust

source-zone untrust

destination-zone trust

destination-zone untrust

source-address 10.1.2.0 mask 255.255.255.0

source-address 10.1.23.0 mask 255.255.255.0

destination-address 10.1.2.0 mask 255.255.255.0

destination-address 10.1.23.0 mask 255.255.255.0

action permit

rule name "Employee_to_Web Server"

source-zone trust

destination-zone dmz

source-address 10.1.23.0 mask 255.255.255.0

destination-address 10.1.22.104 mask 255.255.255.255

service http

service https

action permit

rule name Outbound_to_vGW

source-zone untrust

destination-zone local

destination-address 10.1.70.23 mask 255.255.255.255

service http

service https

action permit

rule name "SSL VPN_to_Web Server"

source-zone local

destination-zone dmz

source-address 10.1.22.23 mask 255.255.255.255

destination-address 10.1.22.104 mask 255.255.255.255

service http

页 173
174

service https

action permit

nat-policy

rule name Employee_outbound

source-zone trust

egress-interface GigabitEthernet1/0/0

source-address 10.1.23.0 mask 255.255.255.0

action source-nat easy-ip

return

switch vsys vfw1

interface GigabitEthernet1/0/2

undo shutdown

ip binding vpn-instance vfw1

ip address 10.1.23.23 255.255.255.0

service-manage ping permit

firewall zone trust

set priority 85

add interface GigabitEthernet1/0/2

firewall zone untrust

set priority 5

add interface Virtual-if1

security-policy

rule name Empolyee_outbound

页 174
175

source-zone trust

destination-zone untrust

source-address 10.1.23.0 mask 255.255.255.0

action permit

rule name Employee_inbound

source-zone untrust

destination-zone trust

destination-address 10.1.23.0 mask 255.255.255.0

action permit

ip route-static 0.0.0.0 0.0.0.0 public

return

6.4.4 SW3 的配置


#

sysname SW3

vlan batch 2 to 100

dot1x enable

dot1x authentication-method eap

dot1x mc-trigger port-up-send enable

dot1x free-ip 10.1.5.107 255.255.255.255

stp region-configuration

region-name HCIE

instance 1 vlan 3 5 to 20 23 to 100

instance 2 vlan 2 4 21

instance 3 vlan 22

active region-configuration

页 175
176

radius-server template default

radius-server template radius

radius-server shared-key Huawei@123

radius-server authentication 10.1.5.107 1812 source ip-address 10.1.3.3 weight 80

radius-server accounting 10.1.5.107 1813 source ip-address 10.1.3.3 weight 80

radius-server authorization 10.1.5.107 shared-key cipher Huawei@123

aaa

authentication-scheme radius

authentication-mode radius

accounting-scheme radius

accounting-mode radius

domain default

authentication-scheme radius

accounting-scheme radius

radius-server radius

interface Vlanif2

ip address 10.1.2.3 255.255.255.0

interface Vlanif3

ip address 10.1.3.3 255.255.255.0

interface GigabitEthernet0/0/1

port link-type access

port default vlan 6

interface GigabitEthernet0/0/2

port link-type access

页 176
177

port default vlan 7

interface GigabitEthernet0/0/3

port link-type access

port default vlan 6

interface GigabitEthernet0/0/4

port link-type access

port default vlan 7

interface GigabitEthernet0/0/5

port link-type access

port default vlan 7

interface GigabitEthernet0/0/6

port link-type access

port default vlan 6

interface GigabitEthernet0/0/7

port link-type access

port default vlan 4

interface GigabitEthernet0/0/8

port link-type access

port default vlan 4

interface GigabitEthernet0/0/9

port link-type access

port default vlan 3

页 177
178

interface GigabitEthernet0/0/10

port link-type access

port default vlan 2

dot1x enable

dot1x domain default

dot1x authentication-method eap

ospf 1

area 0.0.0.0

network 10.1.2.0 0.0.0.255

network 10.1.3.0 0.0.0.255

return

页 178
179

7 用户管理技术实验

7.1 实验介绍

7.1.1 关于本实验
某公司园区网络内存在办公区域,办公区域分为两个部门,市场部和销售部。两个部门都有访
问外网的需求,企业在 ISP 处购买了 100M 带宽,但经过管理员调查发现,两个部门员工
P2P 和在线视频的访问量巨大,导致该企业有限的带宽资源经常被此类流量占据,而 Email、
ERP 等关键业务流量无法得到保证,经常发生邮件发不出去、页面无法访问等情况,严重影
响了企业的正常运作。因此,需要对两部门的员工上网时长以及带宽进行限制。

7.1.2 实验目的
 了解用户管理的应用场景

 掌握用户管理的配置方法

7.1.3 实验组网介绍

页 179
180

图7-1 用户管理实验拓扑图

7.1.4 实验规划
实验拓扑如图所示,企业管理员为了改善上述现象,希望利用防火墙提供的带宽管理功能,实
现如下需求:

为了不影响正常业务,在任何时间内限制 P2P 和在线视频等最大带宽不超过 20Mbps。为了


更好的控制 P2P、在线视频流量,可以通过限制连接数的方式,限制最大连接数不超过
100。

为了让 Email、ERP 等应用在正常工作时间内不受到影响,此类流量可获得的最小带宽不少于


70Mbps。

实验设备信息

设备 端口 安全区域/IP地址

安全区域:trust
GE1/0/1
IP地址:10.1.6.21/24

安全区域:isp1,区域优先级15
FW1 GE1/0/3
IP地址:10.1.9.21/24

安全区域:dmz2,区域优先级40
GE1/0/5
IP地址:10.1.8.21/24

安全区域:dmz
GE1/0/0
IP地址:10.1.5.22/24

安全区域:trust
GE1/0/1
IP地址:10.1.6.22/24
FW2
安全区域:isp1,区域优先级15
GE1/0/3
IP地址:10.1.9.22/24

安全区域:dmz2,区域优先级40
GE1/0/5
IP地址:10.1.8.22/24

成员端口:GE0/0/1与GE0/0/2
R1 Eth-trunk1
IP地址:10.1.9.11/24

页 180
181

Eth1/0/1 10.1.40.11/24

Eth1/0/0 10.1.6.14/24
R4
Eth1/0/1 10.1.3.14/24

GE0/0/9 10.1.3.3/24
SW3
GE1/0/10 10.1.2.3/24

PC1 / 10.1.2.101/32

7.2 实验任务配置

7.2.1 配置前提
各设备上的 IP 地址无需配置。

路由器,交换机上的动态路由协议不需要配置,学员只需要在防火墙上进行操作。

参照实验 1 的实验内容完成公司园区网络的安全区域,路由协议以及双机热备的部署,本实
验不再重复展示配置内容。

本实验与实验 6 中的 802.1X 实验内容冲突,验证本实验之前,请在 SW3 上将 802.1X 的相


关配置删除。

7.2.2 配置思路
1. 配置认证策略。为市场部和销售部创建用户组,并在市场部创建 employee1,在销售部创
建 employee2,密码都为 Huawei@123。用户认证成功后,才能访问 Internet。

2. 配置带宽管理。在工作时间内,限制 P2P 和在线视频的流量不超过 20M,限制最大连接


数不超过 100;保证 email 与 ERP 的流量不少于 70M。

7.2.3 配置步骤
步骤 1 配置认证策略

在 FW1 上为市场部和销售部创建用户组 Marketing dept 和 Sales dept,并将 employee1


用于加入 Marketing dept,并将 employee2 用于加入 Sales dept。

# 在 FW1 上选择“对象>用户>default”,在用户/用户组/安全组管理列表中,单击“新
建”,创建用户组,如下图。

页 181
182

页 182
183

配置完成后,在 FW1 上配置认证策略,对园区内上网的用户进行认证,认证方式为 Portal 认


证。

#在 FW1 上选择“对象>用户>认证策略”,在认证策略列表中,单击“新建”,本节实验中
使用 PC1 模拟市场部和销售部的员工,如下图。

页 183
184

# 配置 Portal 认证参数,选择“对象>用户>认证选项”,选择“本地 Portal”,根据实际需求


修改 Portal 认证的协议与端口号,如果没有特殊需求,课保持默认,配置完成后点击“应
用”,如下图。

# 配置安全策略,放行员工到防火墙的认证流量。选择“策略>安全策略>安全策略”,新建
安全策略,如下图。

页 184
185

# 配置安全策略,放行员工访问 Internet 的流量。如下图。

步骤 2 配置带宽管理

防火墙的出口带宽为 100M,在工作时间内,限制两个部门的员工访问 P2P 和在线视频的流


量不超过 20M,限制最大连接数不超过 100;保证 email 与 ERP 的流量不少于 70M。

# 配置时间段,工作时间设置为周一到周五,每天 09:00~18:00,选择“对象>时间段”,新
建时间段,配置如下图。

页 185
186

# 新建带宽通道,根据规划为 P2P 和在线视频的流量新建带宽通道,选择“策略>带宽管理>


带宽通道”,配置如下图。

页 186
187

页 187
188

# 新建带宽策略,根据规划调用不同的带宽通道,选择“策略>带宽管理>带宽策略”,配置
如下图。

页 188
189

页 189
190

7.3 结果验证

7.3.1 验证 Portal 认证
# 登录 PC1,在浏览器中输入 Portal 认证的链接 https://10.1.6.21.:8887,如下图,提示输
入用户名与密码。

页 190
191

# 输入市场部用户名/密码:employee1/Huawei@123, 认证成功后即可访问 Internet。

# 用户成功后,依据配置带宽管理策略控制用户的访问流量。销售部员工请自行验证,不再
赘述。

页 191
192

7.4 配置参考

7.4.1 FW1 的配置


#

sysname FW1

hrp enable

hrp interface GigabitEthernet1/0/5 remote 10.1.8.22

time-range working_time

period-range 09:00:00 to 18:00:00 working-day

interface GigabitEthernet1/0/1

undo shutdown

ip address 10.1.6.21 255.255.255.0

link-group 1

service-manage http permit

service-manage https permit

service-manage ping permit

interface GigabitEthernet1/0/3

undo shutdown

ip address 10.1.9.21 255.255.255.0

link-group 1

service-manage ping permit

interface GigabitEthernet1/0/5

undo shutdown

ip address 10.1.8.21 255.255.255.0

link-group 1

页 192
193

service-manage ping permit

firewall zone trust

set priority 85

add interface GigabitEthernet1/0/1

firewall zone name isp1 id 4

set priority 15

add interface GigabitEthernet1/0/3

firewall zone name dmz2 id 5

set priority 40

add interface GigabitEthernet1/0/5

ospf 1 router-id 21.21.21.21

area 0.0.0.0

network 10.1.5.0 0.0.0.255

network 10.1.6.0 0.0.0.255

network 10.1.9.0 0.0.0.255

network 10.1.10.0 0.0.0.255

security-policy

rule name Office_outbound

source-zone trust

destination-zone isp1

source-address 10.1.2.0 mask 255.255.255.0

action permit

rule name Employee_to_FW_Portal_authen

source-zone local

source-zone trust

页 193
194

destination-zone local

destination-zone trust

source-address 10.1.2.0 mask 255.255.255.0

source-address 10.1.6.0 mask 255.255.255.0

destination-address 10.1.2.0 mask 255.255.255.0

destination-address 10.1.6.0 mask 255.255.255.0

action permit

auth-policy

rule name Portal_authen

source-zone trust

destination-zone isp1

source-address 10.1.2.0 mask 255.255.255.0

action auth

traffic-policy

profile P2P_profile

bandwidth maximum-bandwidth whole both 20000

bandwidth connection-limit whole both 100

profile email_ERP_profile

bandwidth guaranteed-bandwidth whole both 70000

rule name email_ERP_policy

source-zone trust

destination-zone isp1

source-address 10.1.2.0 mask 255.255.255.0

user user-group "/default/marketing dept"

user user-group "/default/sales dept"

application category Business_Systems

application category Business_Systems sub-category Email

application category Business_Systems sub-category WebMail

页 194
195

time-range working_time

action qos profile email_ERP_profile

rule name P2P_policy

source-zone trust

destination-zone isp1

source-address 10.1.2.0 mask 255.255.255.0

user user-group "/default/marketing dept"

user user-group "/default/sales dept"

application category Entertainment sub-category Peercasting

application category General_Internet sub-category FileShare_P2P

application label P2P-Based

time-range working_time

action qos profile P2P_profile

return

7.4.2 FW2 的配置


#

sysname FW2

hrp enable

hrp standby-device

hrp interface GigabitEthernet1/0/5 remote 10.1.8.21

time-range working_time

period-range 09:00:00 to 18:00:00 working-day

interface GigabitEthernet1/0/1

undo shutdown

ip address 10.1.6.22 255.255.255.0

service-manage http permit

页 195
196

service-manage https permit

service-manage ping permit

interface GigabitEthernet1/0/3

undo shutdown

ip address 10.1.9.22 255.255.255.0

service-manage ping permit

ipsec policy ipsec1512231040

interface GigabitEthernet1/0/5

undo shutdown

ip address 10.1.8.22 255.255.255.0

service-manage ping permit

firewall zone trust

set priority 85

add interface GigabitEthernet1/0/1

firewall zone name isp1 id 4

set priority 15

add interface GigabitEthernet1/0/3

firewall zone name dmz2 id 5

set priority 40

add interface GigabitEthernet1/0/5

ospf 1 router-id 22.22.22.22

area 0.0.0.0

network 10.1.5.0 0.0.0.255

network 10.1.6.0 0.0.0.255

页 196
197

network 10.1.9.0 0.0.0.255

network 10.1.10.0 0.0.0.255

security-policy

rule name Office_outbound

source-zone trust

destination-zone isp1

source-address 10.1.2.0 mask 255.255.255.0

action permit

rule name Employee_to_FW_Portal_authen

source-zone local

source-zone trust

destination-zone local

destination-zone trust

source-address 10.1.2.0 mask 255.255.255.0

source-address 10.1.6.0 mask 255.255.255.0

destination-address 10.1.2.0 mask 255.255.255.0

destination-address 10.1.6.0 mask 255.255.255.0

action permit

auth-policy

rule name Portal_authen

source-zone trust

destination-zone isp1

source-address 10.1.2.0 mask 255.255.255.0

action auth

traffic-policy

profile P2P_profile

bandwidth maximum-bandwidth whole both 20000

页 197
198

bandwidth connection-limit whole both 100

profile email_ERP_profile

bandwidth guaranteed-bandwidth whole both 70000

rule name email_ERP_policy

source-zone trust

destination-zone isp1

source-address 10.1.2.0 mask 255.255.255.0

user user-group "/default/marketing dept"

user user-group "/default/sales dept"

application category Business_Systems

application category Business_Systems sub-category Email

application category Business_Systems sub-category WebMail

time-range working_time

action qos profile email_ERP_profile

rule name P2P_policy

source-zone trust

destination-zone isp1

source-address 10.1.2.0 mask 255.255.255.0

user user-group "/default/marketing dept"

user user-group "/default/sales dept"

application category Entertainment sub-category Peercasting

application category General_Internet sub-category FileShare_P2P

application label P2P-Based

time-range working_time

action qos profile P2P_profile

return

页 198
199

8 IPv6 安全技术

8.1 实验介绍

8.1.1 关于本实验
某企业在内部网络部署了防火墙来连接办公网络与服务器区域,并使用 IPv6 实现网络的互
通。具体需求如下:

 为方便后期扩展,使用 OSPFv3 进行路由的传递。

 为了减少外部路由信息的传递,提高员工办公网络的路由器性能和网络质量,要求把办公
网络所在区域配置为 Stub 区域。

 为保护骨干区域,骨干区域内的设备之间需要开启认证,防止非法设备的接入。

8.1.2 实验目的
 掌握 IPv6 的配置方法

 掌握 OSPFv3 的配置方法

页 199
200

8.1.3 实验组网介绍

图8-1 IPv6 安全实验拓扑图

8.1.4 实验规划
本实验需要在各设备上手动配置 IPv6 地址,各设备上的 IPv6 地址如下表。OSPFv3 区域划分
如拓扑图所示。

实验设备信息

设备 端口 安全区域/IP地址

安全区域:untrust
GE1/0/0
IP地址:2003::2/64
FW3
安全区域:dmz
GE1/0/1
IP地址:2004::1/64

GE0/0/5 2002::2/64
SW2
GE0/0/7 2003::1/64

GE0/0/1 2001::1/64
R3
GE0/0/2 2002::1/64

PC2 / 通过RA自动获取地址

页 200
201

Web服务器 / 通过RA自动获取地址

8.2 实验任务配置

8.2.1 配置思路
1. 配置 IPv6 地址,根据实验规划配置各设备上的 IPv6 地址。

2. 配置 OSPFv3,根据拓扑部署 OSPFv3,并实现路由互通。

3. 部署特殊区域,将办公区域的网络配置为 Stub 区域,减少 Area1 内的路由信息;并将骨


干区域内的设备之间开启认证,密码为 Huawei@123。

8.2.2 配置步骤
步骤 1 配置 IPv6 地址

# 根据规划,在 R3 上配置 IPv6 地址,如下。


<R3> system-view
[R3] interface GigabitEthernet 0/0/1
[R3-GigabitEthernet0/0/1] ipv6 enable
[R3-GigabitEthernet0/0/1] ipv6 address 2001::1 64
[R3-GigabitEthernet0/0/1] undo ipv6 nd ra halt
[R3-GigabitEthernet0/0/1] quit
[R3] interface GigabitEthernet 0/0/2
[R3-GigabitEthernet0/0/2] ipv6 enable
[R3-GigabitEthernet0/0/2] ipv6 address 2002::1 64
[R3-GigabitEthernet0/0/2] quit

# 配置完成后,检查配置的 IPv6 地址,如下。


[R3] display ipv6 interface brief
*down: administratively down
(l): loopback
(s): spoofing
Interface Physical Protocol
GigabitEthernet0/0/1 up up
[IPv6 Address] 2001::1
GigabitEthernet0/0/2 up up
[IPv6 Address] 2002::1

# 根据规划,在 SW2 上配置 IPv6 地址,如下。


<SW2> system-view

页 201
202

[SW2] ipv6
[SW2] interface Vlanif 60
[SW2-Vlanif60] ipv6 enable
[SW2-Vlanif60] ipv6 address 2002::2 64
[SW2-Vlanif60] quit
[SW2] interface Vlanif 70
[SW2-Vlanif70] ipv6 enable
[SW2-Vlanif70] ipv6 address 2003::1 64
[SW2-Vlanif70] quit

# 配置完成后,检查配置的 IPv6 地址,如下。


[SW2] display ipv6 interface brief
*down: administratively down
(l): loopback
(s): spoofing
Interface Physical Protocol
Vlanif60 up up
[IPv6 Address] 2002::2
Vlanif70 up up
[IPv6 Address] 2003::1

# 在 SW2 上测试与 R3 的连通性,如下图。


[SW2] ping ipv6 2002::1
PING 2002::1 : 56 data bytes, press CTRL_C to break
Reply from 2002::1
bytes=56 Sequence=1 hop limit=64 time = 24 ms
Reply from 2002::1
bytes=56 Sequence=2 hop limit=64 time = 3 ms
Reply from 2002::1
bytes=56 Sequence=3 hop limit=64 time = 2 ms
Reply from 2002::1
bytes=56 Sequence=4 hop limit=64 time = 2 ms
Reply from 2002::1
bytes=56 Sequence=5 hop limit=64 time = 2 ms

--- 2002::1 ping statistics ---


5 packet(s) transmitted
5 packet(s) received
0.00% packet loss
round-trip min/avg/max = 2/6/24 ms

# 根据规划,先在 FW3 上开启 IPv6 功能,选择“面板”,在系统信息中开启 IPv6 功能,如


下图。

页 202
203

# 在 FW3 上配置 IPv6 地址,选择“网路>接口”,在接口列表中编辑接口并配置 IPv6 地


址,如下图。

页 203
204

# 配置完成后,在 FW3 上查看接口状态,如下图。

页 204
205

步骤 2 配置 OSPFv3

# 在 R3 上开启 OSPFv3 进程 1,router-id 为 13.13.13.13。接口 GE0/0/1 宣告进 Area 1,并


将 Area 1 配置为 Stub 区域;接口 GE0/0/2 宣告进 Area 0,配置如下。
[R3] ospfv3 1
[R3-ospfv3-1] router-id 13.13.13.13
[R3-ospfv3-1] quit
[R3] interface GigabitEthernet 0/0/1
[R3-GigabitEthernet0/0/1] ospfv3 1 area 1
[R3-GigabitEthernet0/0/1] quit
[R3] interface GigabitEthernet 0/0/2
[R3-GigabitEthernet0/0/2] ospfv3 1 area 0
[R3-GigabitEthernet0/0/2] quit
[R3] ospfv3 1
[R3-ospfv3-1] area 1
[R3-ospfv3-1-area-0.0.0.1] stub
[R3-ospfv3-1-area-0.0.0.1] quit
[R3-ospfv3-1] quit

# 在 SW2 上开启 OSPFv3 进程 1,router-id 为 2.2.2.2。接口 vlanif60 和 vlanif70 都宣告进


Area 0,配置如下。
[SW2] ospfv3 1
[SW2-ospfv3-1] router-id 2.2.2.2
[SW2-ospfv3-1] quit
[SW2] interface Vlanif 60
[SW2-Vlanif60] ospfv3 1 area 0
[SW2-Vlanif60] quit
[SW2] interface Vlanif 70
[SW2-Vlanif70] ospfv3 1 area 0
[SW2-Vlanif70] quit

# 在 FW2 上开启 OSPFv3 进程 1,router-id 为 23.23.23.23。接口 GE1/0/0 宣告进 Area 0,


接口 GE1/0/1 宣告进 Area 2。

# 在 FW3 上选择“网络>路由>OSPF”,在 OSPF 列表中新建 OSPFv3 进程 1,如下图。

页 205
206

# 配置完成后,在 OSPFv3 列表中点击“高级”,如下图。

# 创建 OSPFv3 区域,新建 Area 0,并将接口 GE1/0/0 加入 Area 0;新建 Area 2 区域,并


将接口 GE1/0/1 加入 Area 2,如下图。

页 206
207

# 配置完成后,在 SW2 上查看 OSPFv3 邻居关系,如下。


<SW2> display ospfv3 peer
OSPFv3 Process (1)
OSPFv3 Area (0.0.0.0)
Neighbor ID Pri State Dead Time Interface Instance ID
13.13.13.13 1 Full/DR 00:00:35 Vlanif60 0
23.23.23.23 1 Full/Backup 00:00:37 Vlanif70 0

步骤 3 配置 OSPFv3 区域 0 认证

# 在 R3 上开启 Area 0 认证,认证方式为 hmac-sha256,key-id 为 1,密码为


Huawei@123,配置如下。
[R3] ospfv3 1
[R3-ospfv3-1] area 0
[R3-ospfv3-1-area-0.0.0.0] authentication-mode hmac-sha256 key-id 1 cipher
Huawei@123
[R3-ospfv3-1-area-0.0.0.0] quit
[R3-ospfv3-1] quit

# 在 SW2 上开启 Area 0 认证,认证方式为 hmac-sha256,key-id 为 1,密码为


Huawei@123,配置如下。
[SW2] ospfv3 1
[SW2-ospfv3-1] area 0
[SW2-ospfv3-1-area-0.0.0.0] authentication-mode hmac-sha256 key-id 1 cipher
Huawei@123
[SW2-ospfv3-1-area-0.0.0.0] quit
[SW2-ospfv3-1] quit

# 在 FW3 上开启 Area 0 认证,认证方式为 hmac-sha256,key-id 为 1,密码为


Huawei@123,配置如下。
[FW3] ospfv 1
[FW3-ospfv3-1] area 0

页 207
208

[FW3-ospfv3-1-area-0.0.0.0] authentication-mode hmac-sha256 key-id 1 cipher


Huawei@123
[FW3-ospfv3-1-area-0.0.0.0] quit
[FW3-ospfv3-1] quit

# 在 FW3 上放行 PC2 与 Web 服务器之间的 IPv6 流量。配置安全策略,选择“策略>安全策


略>安全策略”,新建安全策略,如下图。

8.3 结果验证

8.3.1 测试 IPv6 地址的连通性


# 登录 PC2,查看获取的 IPv6 地址,如下图。

# 登录 Web 服务器,查看获取的 IPv6 地址,如下图。

页 208
209

# 在 PC2 上测试到 Web 服务器的连通性,如下图,表明 PC2 可以通过 IPv6 地址访问到


Web 服务器。

8.4 配置参考

8.4.1 R3 的配置
#
sysname R3
#
ipv6
#
ospfv3 1
router-id 13.13.13.13
area 0.0.0.0
authentication-mode hmac-sha256 key-id 1 cipher Huawei@123
area 0.0.0.1

页 209
210

stub
#
interface GigabitEthernet0/0/1
ipv6 enable
ipv6 address 2001::1/64
undo ipv6 nd ra halt
ospfv3 1 area 0.0.0.1
#
interface GigabitEthernet0/0/2
ipv6 enable
ipv6 address 2002::1/64
ospfv3 1 area 0.0.0.0
#
return

8.4.2 SW2 的配置


#
sysname SW2
#
ipv6
#
ospfv3 1
router-id 2.2.2.2
area 0.0.0.0
authentication-mode hmac-sha256 key-id 1 cipher Huawei@123
#
interface Vlanif60
ipv6 enable
ipv6 address 2002::2/64
ospfv3 1 area 0.0.0.0
#
interface Vlanif70
ipv6 enable
ipv6 address 2003::1/64
ospfv3 1 area 0.0.0.0
#
interface GigabitEthernet0/0/5
port link-type access
port default vlan 60
#
interface GigabitEthernet0/0/7

页 210
211

port link-type access


port default vlan 70
#
return

8.4.3 FW3 的配置


#
sysname FW3
#
ipv6
#
ospfv3 1
router-id 23.23.23.23
spf timers 5 10
area 0.0.0.0
authentication-mode hmac-sha256 key-id 1 cipher Huawei@123
#
interface GigabitEthernet1/0/0
undo shutdown
ipv6 enable
ipv6 address 2003::2/64
ospfv3 1 area 0.0.0.0
service-manage ping permit
ipsec policy ipsec1512232940
#
interface GigabitEthernet1/0/1
undo shutdown
ipv6 enable
ipv6 address 2004::1/64
undo ipv6 nd ra halt
ospfv3 1 area 0.0.0.2
service-manage ping permit
#
security-policy
rule name "IPv6_to_Web Server"
source-zone dmz
source-zone untrust
destination-zone dmz
destination-zone untrust
source-address 2001:: 64
source-address 2004:: 64

页 211
212

destination-address 2001:: 64
destination-address 2004:: 64
action permit
#
return

页 212
213

9 APT 攻击防御实验

9.1 实验介绍

9.1.1 关于本实验
某公司园区网络中部署了服务器区域,为保护服务器免受 APT 攻击,在园区网络中部署了
FireHunter 设备(沙箱)与防火墙进行联动。当攻击者向企业内网发起 APT 攻击时,防火墙
从网络流量中识别并提取需要进行 APT 检测的文件发送给沙箱。沙箱进行威胁检测,然后将
检测结果返回给防火墙实施阻断操作,防止该文件进入企业内网,保护企业内网免遭攻击。

9.1.2 实验目的
 了解 APT 攻击防御的使用场景

 掌握 APT 攻击防御的配置方法

9.1.3 实验组网介绍

页 213
214

图9-1 APT 攻击防御实验拓扑图

9.1.4 实验规划
公司服务器区域部署了 Mail 服务器,为公司或客户提供 Mail 服务。FW1 与 FW2 部署在网
络出口处,配置双机热备进行设备冗余,并且 FW1,FW2 与 FireHunter 进行联动对发送到
服务器区域的流量进行 APT 攻击检查。

运营商网络主要用于模拟公司出差员工或公司客户通过互联网访问公司服务器资源的场景。

实验设备信息

设备 端口 安全区域/IP地址

安全区域:dmz
GE1/0/0
IP地址:10.1.5.21/24

安全区域:dmz1,区域优先级45
GE1/0/2
IP地址:10.1.7.21/24
FW1
安全区域:isp1,区域优先级15
GE1/0/3
IP地址:10.1.9.21/24

安全区域:dmz2,区域优先级40
GE1/0/5
IP地址:10.1.8.21/24

安全区域:dmz
GE1/0/0
IP地址:10.1.5.22/24

安全区域:dmz1,区域优先级45
GE1/0/2
IP地址:10.1.7.22/24
FW2
安全区域:isp1,区域优先级15
GE1/0/3
IP地址:10.1.9.22/24

安全区域:dmz2,区域优先级40
GE1/0/5
IP地址:10.1.8.22/24

成员端口:GE0/0/1与GE0/0/2
Eth-trunk1
R1 IP地址:10.1.9.11/24

Eth1/0/1 10.1.40.11/24

页 214
215

GE0/0/1 10.1.32.13/24
R3
GE0/0/2 10.1.60.13/24

FireHunter Eth1 10.1.7.51/24

PC2 / 10.1.32.102/32

Mail服务器 / 10.1.5.109/32

9.2 实验任务配置

9.2.1 配置前提
各设备上的 IP 地址无需配置。

路由器,交换机上的动态路由协议不需要配置,学员只需要在防火墙上进行操作。

参照实验 1,3 的实验内容完成公司园区网络的安全区域,路由协议,双机热备以及 NAT


Server 的部署,本实验不再重复展示配置内容。

9.2.2 配置思路
1. 配置防火墙与 FireHunter 联动。当防火墙收到发送给 Mail 服务器的流量,将流量发送给
FireHunter 进行检测。

2. 配置防火墙 APT 攻击防御。当 FireHunter 发现攻击风险后通知防火墙进行阻断。

9.2.3 配置步骤
步骤 1 配置防火墙与 FireHunter 联动

# 根据规划,在 FW1 上配置安全区域,选择“网络>安全区域”,在安全区域列表中新建


DMZ1 区域,并将接口 GE1/0/2 接入安全区域,如下图。

页 215
216

# 在 FW1 上配置 IP 地址,选择“网络>接口”,在接口列表中配置 GE1/0/2 接口 IP 地址,


如下图。

# 根据规划,在 FW2 上配置 IP 地址,选择“网络>接口”,在接口列表中配置 GE1/0/2 接


口 IP 地址,如下图。

页 216
217

# 在 FW1 上配置与沙箱联动,选择“系统>配置>沙箱”,配置“本地沙箱”,沙箱 IP 地址为


10.1.7.51,使用 HTTPS 协议尽心联动,API Key 密码为 Huawei@123,如下图。

# 配置安全策略,在 FW1 上放行与 FireHunter 联动的流量,如下图。

页 217
218

# 登录 FireHunter,配置沙箱与 FW1,FW2 进行联动,选在“配置>联动设备”,在联动设


备列表中添加防火墙(FireHunter 上的联动 API Key 默认为 Huawei@123,不需要更改)如
下图。

页 218
219

# 联动成功后,如下图,状态为绿色圆点表明联动成功。

步骤 2 配置 APT 防御策略

# 在 FW1 上配置 APT 防御策略,对于使用电子邮件发送到园区网络中的可执行文件或压缩


文件进行 APT 检测,选择“对象>安全配置文件>APT 防御”,在 APT 防御配置文件列表中,
配置如下图。

页 219
220

# 在安全策略中调用 APT 防御配置文件,选择“策略>安全策略>安全策略”,配置安全策


略,如下图。

# 登录 FireHunter,配置检测策略,选择“配置>检测策略”,配置完成后,点击“应用”下
发检测策略,如下图。

页 220
221

9.3 结果验证

9.3.1 测试 APT 检测效果


# 登录 PC2,使用邮件给园区内网用户 user1@huawei.com 发送一封邮件,添加沙箱测试
文件为附件,如下图。

# 发送完成后,登录 FireHunter,查看检测结果,选择“分析>场景分析>邮件分析”,如下
图。

# 登录防火墙。选择“监控>日志>业务日志”,查看到防火墙的监测日志,如下图。

页 221
222

9.4 配置参考

9.4.1 FW1 的配置


#
sysname FW1
#
hrp enable
hrp interface GigabitEthernet1/0/5 remote 10.1.8.22
#
interface GigabitEthernet1/0/0
undo shutdown
ip address 10.1.5.21 255.255.255.0
vrrp vrid 1 virtual-ip 10.1.5.254 active
vrrp virtual-mac enable
link-group 1
service-manage ping permit
#
interface GigabitEthernet1/0/2
undo shutdown
ip address 10.1.7.21 255.255.255.0
service-manage http permit
service-manage https permit
service-manage ping permit
service-manage telnet permit
#
interface GigabitEthernet1/0/3
undo shutdown
ip address 10.1.9.21 255.255.255.0
link-group 1
service-manage ping permit
#
interface GigabitEthernet1/0/5
undo shutdown
ip address 10.1.8.21 255.255.255.0
link-group 1
service-manage ping permit
#
firewall zone dmz
set priority 50
add interface GigabitEthernet1/0/0

页 222
223

#
firewall zone name isp1 id 4
set priority 15
add interface GigabitEthernet1/0/3
#
firewall zone name dmz2 id 5
set priority 40
add interface GigabitEthernet1/0/5
#
firewall zone name dmz1 id 6
set priority 45
add interface GigabitEthernet1/0/2
#
ospf 1 router-id 21.21.21.21
area 0.0.0.0
network 10.1.5.0 0.0.0.255
network 10.1.6.0 0.0.0.255
network 10.1.9.0 0.0.0.255
network 10.1.10.0 0.0.0.255
#
profile type av name AntiVirus
undo http-detect
undo ftp-detect
smtp-detect action delete-attachment
pop3-detect action delete-attachment
imap-detect direction both action delete-attachment
undo nfs-detect
undo smb-detect
#
sandbox default
type FireHunter
ip 10.1.7.51 port 5002
protocol https
api-key Huawei@123
linkage enable
file-set EXE max-size 2048
file-set GZIP max-size 2048
file-set OFFICE max-size 2048
file-set PDF max-size 2048
file-set PICTURE max-size 200
file-set WEB max-size 200
#

页 223
224

profile type aapt name APT_defense


undo sandbox-detect HTTP
undo sandbox-detect HTTPS
undo sandbox-detect FTP
undo sandbox-detect NFS
undo sandbox-detect SMB
file-type BAT CLASS PE32 JAR SWF RAR ZIP GZ
file-type 7Z CAB BZIP2 TAR
sandbox-type local
#
security-policy
rule name "Outbound_to_Mail Server"
source-zone isp1
destination-zone dmz
destination-address 10.1.5.109 mask 255.255.255.255
profile av AntiVirus
profile aapt APT_defense
action permit
rule name FW1_FireHunter
source-zone dmz1
source-zone local
destination-zone dmz1
destination-zone local
source-address 10.1.7.21 mask 255.255.255.255
source-address 10.1.7.51 mask 255.255.255.255
destination-address 10.1.7.21 mask 255.255.255.255
destination-address 10.1.7.51 mask 255.255.255.255
action permit
rule name FW2_FireHunter
source-zone dmz1
source-zone local
destination-zone dmz1
destination-zone local
source-address 10.1.7.22 mask 255.255.255.255
source-address 10.1.7.51 mask 255.255.255.255
destination-address 10.1.7.22 mask 255.255.255.255
destination-address 10.1.7.51 mask 255.255.255.255
action permit
#
return

页 224
225

9.4.2 FW2 的配置


#
sysname FW2
#
hrp enable
hrp standby-device
hrp interface GigabitEthernet1/0/5 remote 10.1.8.21
#
interface GigabitEthernet1/0/0
undo shutdown
ip address 10.1.5.22 255.255.255.0
vrrp vrid 1 virtual-ip 10.1.5.254 standby
vrrp virtual-mac enable
service-manage ping permit
#
interface GigabitEthernet1/0/2
undo shutdown
ip address 10.1.7.22 255.255.255.0
service-manage http permit
service-manage https permit
service-manage ping permit
service-manage telnet permit
#
interface GigabitEthernet1/0/3
undo shutdown
ip address 10.1.9.22 255.255.255.0
service-manage ping permit
#
interface GigabitEthernet1/0/5
undo shutdown
ip address 10.1.8.22 255.255.255.0
service-manage ping permit
#
firewall zone dmz
set priority 50
add interface GigabitEthernet1/0/0
#
firewall zone name isp1 id 4
set priority 15
add interface GigabitEthernet1/0/3
#

页 225
226

firewall zone name dmz2 id 5


set priority 40
add interface GigabitEthernet1/0/5
#
firewall zone name dmz1 id 6
set priority 45
add interface GigabitEthernet1/0/2
#
ospf 1 router-id 22.22.22.22
area 0.0.0.0
network 10.1.5.0 0.0.0.255
network 10.1.6.0 0.0.0.255
network 10.1.9.0 0.0.0.255
network 10.1.10.0 0.0.0.255
#
profile type av name AntiVirus
undo http-detect
undo ftp-detect
smtp-detect action delete-attachment
pop3-detect action delete-attachment
imap-detect direction both action delete-attachment
undo nfs-detect
undo smb-detect
#
sandbox default
type FireHunter
ip 10.1.7.51 port 5002
protocol https
api-key Huawei@123
linkage enable
file-set EXE max-size 2048
file-set GZIP max-size 2048
file-set OFFICE max-size 2048
file-set PDF max-size 2048
file-set PICTURE max-size 200
file-set WEB max-size 200
#
profile type aapt name APT_defense
undo sandbox-detect HTTP
undo sandbox-detect HTTPS
undo sandbox-detect FTP
undo sandbox-detect NFS

页 226
227

undo sandbox-detect SMB


file-type BAT CLASS PE32 JAR SWF RAR ZIP GZ
file-type 7Z CAB BZIP2 TAR
sandbox-type local
#
security-policy
rule name "Outbound_to_Mail Server"
source-zone isp1
destination-zone dmz
destination-address 10.1.5.109 mask 255.255.255.255
profile av AntiVirus
profile aapt APT_defense
action permit
rule name FW2_FireHunter
source-zone dmz1
source-zone local
destination-zone dmz1
destination-zone local
source-address 10.1.7.22 mask 255.255.255.255
source-address 10.1.7.51 mask 255.255.255.255
destination-address 10.1.7.22 mask 255.255.255.255
destination-address 10.1.7.51 mask 255.255.255.255
action permit
#
return

页 227

You might also like