Files
NE_YuR/big1/big1.typ
2025-11-06 00:01:42 +08:00

1387 lines
74 KiB
Typst
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

#import "labtemplate.typ": *
#show: nudtlabpaper.with(title: "异构网络设计综合实验",
author1: "程景愉",
id1: "202302723005",
advisor: "张军",
jobtitle: "工程师",
lab: "306-707",
date: "2024.12.24",
header_str: "《网络工程》实验报告",
)
#set page(header: [
#set par(spacing: 6pt)
#align(center)[#text(size: 11pt)[《网络工程》实验报告]]
#v(-0.3em)
#line(length: 100%, stroke: (thickness: 1pt))
],)
#show heading: it => box(width: 100%)[
#v(0.50em)
#set text(font: hei)
#it.body
]
#outline(title: "目录",depth: 3, indent: 1em)
#outline(
title: [图目录],
target: figure.where(kind: image),
)
#show heading: it => box(width: 100%)[
#v(0.50em)
#set text(font: hei)
#counter(heading).display()
// #h(0.5em)
#it.body
]
// Display inline code in a small box
// that retains the correct baseline.
#show raw.where(block: false): it => box(
text(font: ("Consolas","Noto Sans CJK SC"), it),
fill: luma(240),
inset: (x: 3pt, y: 0pt),
outset: (y: 3pt),
radius: 2pt,
)
// Display block code in a larger block
// with more padding.
#show raw.where(block: true): it => block(
text(font: ("Consolas","Noto Sans CJK SC"), it),
fill: luma(240),
inset: 6pt,
radius: 3pt,
width: 100%,
)
#set enum(indent: 0.5em,body-indent: 0.5em,)
#pagebreak()
= 实验目的与要求
+ 实验目的:通过本实验,让学员熟悉从网络规划到方案撰写,再到工程实施及测试验收的整个过程。
+ 实验任务:设计和实现一个包含局域网和广域网的中型网络。
#para[
一个完整的组网工程包括需求分析、方案设计、设备选型与采购、硬件安装与配置、软件安装与配置、系统测试与联调、工程验收等若干个环节,其中硬件与应用系统安装、配置工作量大,技术含量高,是信息系统集成或网络工程的关键环节,其中既涉及到技术上的问题,也涉及到工程组织、协调配合上的问题,一个网络工程师只有通过多次工程的实际锻炼,不断积累经验、吸取教训才能提高自己的水平。
]
= 需求分析
#para[
第三建筑公司大楼中需要布设网络基础设施。下面通过需求分析报告与技术分析阐明项目的实施方案。
]
== 需求分析报告书
#align(center)[#block(inset: 14pt,width: 95%,stroke: 0.3pt)[
#align(center)[#text(size:20pt,font:xbsong,)[网络工程项目需求分析报告]]
#set text(font:fsong)
#set align(start)
项目名称:第三建筑公司本部大楼网络工程项目
客户单位:第三建筑公司
承建单位:第三网络工程基础设施公司
日期2024年12月
#set text(font: xbsong)
#line(length: 100%)
#text(size:14pt)[一、项目背景]
#subpara[第三建筑公司(以下简称“贵公司”)目前正在规划公司总部大楼的网络基础设施,旨在建立一个高效、安全、稳定的网络环境,支持公司日常办公、项目管理、数据存储及未来业务扩展需求。由于贵公司对网络设备和技术了解有限,特委托第三网络工程基础设施公司(以下简称“我司”)进行网络规划、设计、实施及维护。
]
#text(size:14pt)[二、项目目标]
#subpara[本项目的主要目标是建立一个覆盖贵公司总部大楼的网络系统,确保所有员工能够顺畅访问内部资源和外部互联网。同时,网络需提供安全、可靠的运行环境,保护公司数据免受外部威胁。此外,网络设计需具备良好的扩展性,能够支持未来业务增长和技术升级。
]
#text(size:14pt)[三、需求详述]
(一)网络覆盖需求
#subpara[贵公司总部大楼中,网络需覆盖所有办公区域、会议室、服务器机房及公共区域。此外,需在公司大楼内提供无线网络覆盖,支持员工移动办公和访客接入。
]
(二)网络性能需求
#subpara[网络需支持高速数据传输,确保员工能够高效访问内部服务器和外部互联网。]
(三)网络安全需求
#subpara[需部署防火墙保护贵公司网络免受外部攻击。不同部门之间的网络流量需进行隔离确保敏感数据的安全性。同时需支持远程员工通过VPN安全访问公司内部资源。
]
(四)网络管理需求
#subpara[所有网络设备需支持集中管理,方便网络管理员进行配置和监控。网络设备需记录日志,便于故障排查和安全审计。网络管理员需能够远程访问和管理网络设备。
]
(五)网络扩展需求
#subpara[网络需预留足够的端口和带宽,以便未来增加新的设备或用户。网络设计需考虑到未来的技术升级,确保能够支持新的网络协议和设备。
]
(六)服务器和存储需求
#subpara[需为贵公司的Web服务器和数据库服务器提供稳定的网络连接。同时需确保重要数据的定期备份和快速恢复能力。
]
(七)终端设备需求
#subpara[所有员工的电脑、打印机等设备需能够接入网络。会议室内的投影仪、视频会议设备等也需接入网络,确保会议和协作的顺利进行。
]
#text(size:14pt)[四、项目交付要求]
#subpara[项目交付内容包括完整的网络拓扑设计及实施方案、所有网络设备的安装、配置及调试、网络安全策略的部署及测试、网络管理系统的部署及培训以及项目文档包括网络拓扑图、设备配置文档、操作手册等。项目需在合同签订后3个月内完成包括设计、采购、安装、调试及测试。
]
#text(size:14pt)[五、预算要求]
#subpara[项目预算需在合理范围内,具体金额可根据设计方案进行调整。我司将确保在满足需求的同时控制成本,提供性价比高的解决方案。
]
#text(size:14pt)[六、其他要求]
(一)培训需求
#subpara[项目实施完成后我司将为贵公司IT团队提供相关设备的操作和维护培训确保其能够独立进行日常管理和故障排查。
]
(二)售后服务
#subpara[我司将提供至少1年的免费售后服务包括设备维护、故障排查及技术支持。同时我司将提供$7 × 24$小时的技术支持热线,确保在出现紧急问题时能够及时响应。
]]]
== 技术分析
#para[
为满足公司大楼的网络需求网络建设需采用多种先进技术。首先需使用虚拟路由冗余协议VRRP确保出口网关的高可用性防止单点故障。其次通过链路聚合技术Eth-trunk提升网络带宽和链路可靠性特别是在核心层与接入层之间。此外堆叠技术用于核心交换机的冗余和扩展确保网络的高效管理和扩展性。VLAN技术用于划分不同部门的安全区域确保网络流量的隔离与安全性。防火墙旁挂系统则通过双机热备技术确保网络安全防护的连续性。最后无线网络覆盖技术用于支持移动办公和访客接入确保网络的全面覆盖。
]
#para[
公司大楼的网络建设需要多种设备来满足需求。首先需要两台路由器AR1、AR2作为出口网关支持VRRP协议。其次核心层需要两台支持堆叠技术的交换机LSW1、LSW2用于连接各个接入层交换机和防火墙。接入层需要多台交换机LSW3、LSW4、LSW5用于连接终端设备如PC、服务器等。防火墙方面需要两台防火墙FW1、FW2用于网络安全防护支持双机热备。此外还需要若干无线接入点AP用于无线网络覆盖。总体来看设备数量包括2台路由器、5台交换机、2台防火墙及若干无线接入点确保网络的全面覆盖与高效运行。
]
== 拓扑图表
#para[
下面给出拓扑图和设备连接表,详细描述公司大楼网络的设计方案。
]
=== 拓扑图
#para[
物理链路的拓扑图如@topo 所示(见下页):
]
#figure(image("实验拓扑.png",format: "png",fit:"stretch",width: 115%),caption: "实验拓扑图")<topo>
#para[
核心交换机有2台它们在物理上是横向而对等的关系。但由于使用了堆叠技术核心层的2台交换机在逻辑上是同一个设备。此外由于使用防火墙旁挂所以需要把核心交换机分成内外两个VPN示例。而这两个VPN实例在逻辑上可以视为2个设备故逻辑拓扑图由横向的2个设备变为了纵向的两个设备如下图所示。
]
#figure(image("逻辑拓扑.png",format: "png",fit:"stretch",width: 30%),caption: "逻辑拓扑图")<logic_topo>
#para[
接下来给出设备连接表(拓扑表):
]
// #para[
#set page(flipped: true)
#align(center)[#figure(caption: "核心交换机拓扑表")[#table(
columns: (auto, auto,auto,auto,auto,auto,auto,auto),
rows:17pt,
[*设备名称*], [*接口*], [*连接设备*], [*对方接口*], [*IP 地址*], [*链路聚合 ID*], [*VLAN*], [*备注*],
[LSW1], [g0/0/1], [LSW2], [g0/0/1], [-], [6], [-], [用于与 LSW2 组建堆叠系统iStack],
[LSW1], [g0/0/7], [LSW2], [g0/0/7], [-], [6], [-], [用于与 LSW2 组建堆叠系统iStack],
[LSW1], [g0/0/3], [AR1], [g0/0/4], [192.168.10.1/24], [2], [VLAN10], [连接出口网关 AR1],
[LSW1], [g0/0/4], [AR2], [g0/0/4], [192.168.10.1/24], [4], [VLAN10], [连接出口网关 AR2],
[LSW1], [g0/0/5], [LSW3], [g0/0/3], [192.168.110.1/24], [-], [VLAN110], [连接接入层交换机 LSW3],
[LSW1], [g0/0/6], [LSW4], [g0/0/3], [192.168.120.1/24], [-], [VLAN120], [连接接入层交换机 LSW4],
[LSW1], [g0/0/8], [FW1], [g0/0/0], [192.168.20.1/24], [3], [VLAN20], [出口防火墙旁挂-外侧],
[LSW1], [g0/0/9], [FW1], [g0/0/1], [192.168.30.1/24], [8], [VLAN30], [出口防火墙旁挂-内侧],
[LSW1], [g0/0/10], [FW2], [g0/0/0], [192.168.20.1/24], [9], [VLAN20], [出口防火墙旁挂-外侧],
[LSW1], [g0/0/11], [FW2], [g0/0/1], [192.168.30.1/24], [10], [VLAN30], [出口防火墙旁挂-内侧],
[LSW1], [g0/0/13], [LSW2], [g0/0/13], [-], [-], [-], [用于多主检测CORE-mad],
[LSW2], [g0/0/1], [LSW1], [g0/0/1], [-], [6], [-], [用于与 LSW1 组建堆叠系统iStack],
[LSW2], [g0/0/7], [LSW1], [g0/0/7], [-], [6], [-], [用于与 LSW1 组建堆叠系统iStack],
[LSW2], [g0/0/3], [AR1], [g0/0/5], [192.168.10.1/24], [2], [VLAN10], [连接出口网关 AR1],
[LSW2], [g0/0/4], [AR2], [g0/0/5], [192.168.10.1/24], [4], [VLAN10], [连接出口网关 AR2],
[LSW2], [g0/0/5], [LSW5], [g0/0/4], [192.168.130.1/24], [11], [VLAN130], [连接接入层交换机 LSW5],
[LSW2], [g0/0/6], [LSW5], [g0/0/5], [192.168.130.1/24], [11], [VLAN130], [连接接入层交换机 LSW5],
[LSW2], [g0/0/8], [FW1], [g0/0/2], [192.168.20.1/24], [3], [VLAN20], [出口防火墙旁挂-外侧],
[LSW2], [g0/0/9], [FW1], [g0/0/3], [192.168.30.1/24], [8], [VLAN30], [出口防火墙旁挂-内侧],
[LSW2], [g0/0/10], [FW2], [g0/0/2], [192.168.20.1/24], [9], [VLAN20], [出口防火墙旁挂-外侧],
[LSW2], [g0/0/11], [FW2], [g0/0/3], [192.168.30.1/24], [10], [VLAN30], [出口防火墙旁挂-内侧],
[LSW2], [g0/0/13], [LSW1], [g0/0/13], [-], [-], [-], [用于多主检测CORE-mad],
)]]<core_topo>
#align(center)[#figure(caption: "出口网关拓扑表")[#table(
align: horizon,
columns: (auto, auto,auto,auto,auto,auto,auto,auto),
// columns: (30pt, auto, 30pt, auto, 80pt, 40pt, auto, auto),
rows: auto,
[*设备名称*], [*接口*], [*连接设备*], [*对方接口*], [*IP 地址*], [*链路聚合 ID*], [*VLAN*], [*备注*],
[AR1], [g0/0/2], [AR3], [g0/0/0], [-], [-], [-], [连接内网出口 AR3],
[AR1], [g0/0/4], [LSW1], [g0/0/3], [192.168.10.2/24], [2], [-], [用聚合链路连接堆叠系统],
[AR1], [g0/0/5], [LSW2], [g0/0/3], [192.168.10.2/24], [2], [-], [用聚合链路连接堆叠系统],
[AR2], [g0/0/3], [AR4], [g0/0/1], [-], [-], [-], [连接内网出口 AR4],
[AR2], [g0/0/4], [LSW1], [g0/0/4], [192.168.10.3/24], [4], [-], [用聚合链路连接堆叠系统],
[AR2], [g0/0/5], [LSW2], [g0/0/4], [192.168.10.3/24], [4], [-], [用聚合链路连接堆叠系统],
[AR3], [g0/0/0], [AR1], [g0/0/2], [-], [-], [-], [连接内网出口 AR1],
[AR3], [g0/0/1], [外部路由器], [未知], [-], [-], [-], [连接外部网络],
[VRRP], [-], [CORE], [-], [192.168.10.100/24], [-], [-], [VRRP 网关连接 Public 区域],
)]]<gateway_topo>
#align(center)[#figure(caption: "终端设备与服务器拓扑表")[#table(
columns: (auto, auto, auto, auto, auto, auto, auto, auto),
rows: auto,
[*设备名称*], [*接口*], [*连接设备*], [*对方接口*], [*IP 地址*], [*链路聚合 ID*], [*VLAN*], [*备注*],
[PC1], [3号口], [LSW3], [g0/0/1], [-], [-], [VLAN110], [属于 VLAN110],
[PC2], [8号口], [LSW3], [g0/0/2], [-], [-], [VLAN110], [属于 VLAN110],
[Asso], [2号口], [LSW4], [g0/0/1], [-], [-], [VLAN120], [属于 VLAN120],
[Boss], [6号口], [LSW4], [g0/0/2], [-], [-], [VLAN120], [属于 VLAN120],
[WebServer], [N/A], [LSW5], [g0/0/2], [192.168.130.10], [-], [-], [Web服务器],
[DataServer], [N/A], [LSW5], [g0/0/2], [192.168.130.10], [-], [-], [数据库服务器],
)]]
#align(center)[#figure(caption: "接入层交换机拓扑表")[#table(
columns: (auto, auto, auto, auto, auto, auto, auto, auto),
rows: 25pt,
align: horizon,
[*设备名称*], [*接口*], [*连接设备*], [*对方接口*], [*IP 地址*], [*链路聚合 ID*], [*VLAN*], [*备注*],
[LSW3], [g0/0/1], [PC1], [3号口], [-], [-], [-], [Access],
[LSW3], [g0/0/2], [PC2], [8号口], [-], [-], [-], [Access],
[LSW3], [g0/0/3], [LSW1], [g0/0/5], [-], [-], [VLAN110], [Trunk],
[LSW3], [g0/0/4], [LSW2], [-], [-], [-], [-], [-],
[LSW3], [g0/0/5\~g0/0/7], [新接入设备], [不分接口], [-], [-], [-], [新接入设备端口],
[LSW4], [g0/0/1], [Asso], [2号口], [-], [-], [-], [Access],
[LSW4], [g0/0/2], [Boss], [6号口], [-], [-], [-], [Access],
[LSW4], [g0/0/3], [LSW1], [g0/0/6], [-], [-], [VLAN120], [Trunk],
[LSW4], [g0/0/4\~g0/0/7], [新接入设备], [不分接口], [-], [-], [-], [新接入设备端口],
[LSW5], [g0/0/2], [DataServer], [不分接口], [192.168.130.10], [-], [-], [Web服务器地址],
[LSW5], [g0/0/2], [WebServer], [不分接口], [192.168.130.10], [-], [-], [DNS服务器地址],
[LSW5], [g0/0/3], [AP1], [不分接口], [-], [-], [-], [-],
[LSW5], [g0/0/4], [LSW2], [g0/0/5], [-], [-], [-], [-],
[LSW5], [g0/0/5], [LSW2], [g0/0/6], [-], [-], [-], [-],
)]]<access_topo>
#align(center)[#figure(caption: "防火墙拓扑表")[#table(
align: horizon,
columns: (auto, auto, auto, auto, 80pt, auto, auto, auto),
rows: 30pt,
[*设备名称*], [*接口*], [*连接设备*], [*对方接口*], [*IP 地址*], [*链路聚合 ID*], [*VLAN*], [*备注*],
[FW1], [g0/0/0], [LSW1], [g0/0/8], [192.168.20.2/24], [3], [VLAN20], [出口防火墙旁挂-外侧],
[FW1], [g0/0/1], [LSW1], [g0/0/9], [192.168.30.2/24], [8], [VLAN30], [出口防火墙旁挂-内侧],
[FW1], [g0/0/2], [LSW2], [g0/0/8], [192.168.20.2/24], [3], [VLAN20], [出口防火墙旁挂-外侧],
[FW1], [g0/0/3], [LSW2], [g0/0/9], [192.168.30.2/24], [8], [VLAN30], [出口防火墙旁挂-内侧],
[FW1], [g0/0/4], [FW2], [g0/0/4], [10.1.1.1/24], [7], [-], [用于组建防火墙旁挂系统],
[FW1], [g0/0/5], [FW2], [g0/0/5], [10.1.1.1/24], [7], [-], [用于组建防火墙旁挂系统],
[FW2], [g0/0/0], [LSW1], [g0/0/10], [192.168.20.3/24], [3], [VLAN20], [出口防火墙旁挂-外侧],
[FW2], [g0/0/1], [LSW1], [g0/0/11], [192.168.30.3/24], [8], [VLAN30], [出口防火墙旁挂-内侧],
[FW2], [g0/0/2], [LSW2], [g0/0/10], [192.168.20.3/24], [3], [VLAN20], [出口防火墙旁挂-外侧],
[FW2], [g0/0/3], [LSW2], [g0/0/11], [192.168.30.3/24], [8], [VLAN30], [出口防火墙旁挂-内侧],
[FW2], [g0/0/4], [FW1], [g0/0/4], [10.1.1.2/24], [7], [-], [用于组建防火墙旁挂系统],
[FW2], [g0/0/5], [FW1], [g0/0/5], [10.1.1.2/24], [7], [-], [用于组建防火墙旁挂系统],
)]]<firewall_topo>
// ]
= 实验设备
#align(center)[#table(
columns: (auto, auto,auto,auto),
rows:40pt,
inset: 10pt,
align: horizon+center,
table.header(
[设备名称], [设备型号], [设备数量],[设备名称]
),
"交换机", "华为S5735", "4","LSW1、LSW2、LSW3、LSW4",
"集线器", "TPLINK TL-SG1008+","1","LSW5",
"路由器", "华为AR6120-S", "2","AR1、AR2",
"防火墙", "华为USG6303E-AC", "3","FW1、FW2",
"无线路由器", "TP-LINK AX3000", "1","AP",
"PC", "联想启天M410
Windows 10", "4","PC1、PC2、Asso、Boss",
"PC", "联想拯救者R9000P
Windows 11 23H2", "1","外网主机",
"PC", "联想拯救者Y9000P
Windows 10 24H4", "1","DataServer、WebServer",
)]
另有网线、控制线若干。
= 实验步骤及结果
#para[]
== 设备连接
#para[
将所有设备按照拓扑图连接好,确保每个设备的接口都正确连接:
]
#figure(image("机柜正面接线图.jpg",format: "jpg",fit:"stretch",width: 60%),caption: "机柜正面接线图")<front>
#figure(image("机柜背面接线图.jpg",format: "jpg",fit:"stretch",width: 80%),caption: "机柜背面接线图")<back>
== 配置核心层堆叠系统基本功能
=== 组建堆叠系统
#para[
在此处配置开始之前必须明确本设备的逻辑堆叠端口stack-port 0/1对应的物理端口必须连接邻设备的逻辑堆叠端口stack-port 0/2对应的物理端口否则堆叠组建不成功。
]
+ 配置逻辑堆叠端口并加入物理成员端口。
- 配置LSW1的业务口g0/0/1、g0/0/7为物理成员端口并加入到相应的逻辑堆叠端口。
```
<HUAWEI> system-view
[HUAWEI] sysname LSW1
[LSW1] interface stack-port 0/1
[LSW1-stack-port0/1] port interface g0/0/1 enable
Warning: Enablingstack function may cause configuration loss on the interface. Continue? [Y/N]:y
Info: This operation may take a few seconds. Please wait.
[LSW1-stack-port0/1] quit
[LSW1] interface stack-port 0/2
[LSW1-stack-port0/2] port interface g0/0/7 enable
Warning: Enablingstack function may cause configuration loss on the interface. Continue? [Y/N]:y
Info: This operation may take a few seconds. Please wait.
[LSW1-stack-port0/2] quit
```
- 配置LSW2的业务口g0/0/1、g0/0/7为物理成员端口并加入到相应的逻辑堆叠端口。
```
<HUAWEI> system-view
[HUAWEI] sysname LSW2
[LSW2] interface stack-port 0/1
[LSW2-stack-port0/1] port interface g0/0/1 enable
Warning: Enablingstack function may cause configuration loss on the interface. Continue? [Y/N]:y
Info: This operation may take a few seconds. Please wait.
[LSW2-stack-port0/1] quit
[LSW2] interface stack-port 0/2
[LSW2-stack-port0/2] port interface g0/0/7 enable
Warning: Enablingstack function may cause configuration loss on the interface. Continue? [Y/N]:y
Info: This operation may take a few seconds. Please wait.
[LSW2-stack-port0/2] quit
```
+ 配置堆叠ID和堆叠优先级
- 配置LSW1的堆叠优先级为200。
```
[LSW1] stack slot 0 priority 200
Warning: Do not frequently modify the Priority because it will make the stack split. Continue? [Y/N]:y
```
- 配置LSW2的堆叠ID即Slot为1。
```
[LSW2] stack slot 0 renumber 1
Warning: All the configurations related to the slot ID will be lost after the slot ID is modified.
Do not frequently modify the slot ID because it will make the stack split. Continue? [Y/N]:y
Info: Stack configuration has been changed, and the device needs to restart to make the configuration effective.
```
+ 在每台设备上、在用户界面下输入`save`命令,保存配置信息。
+ 关闭设备并按顺序启动
- 关闭LSW1、LSW2。
- 先启动LSW1等待2分钟左右控制机能够登录到LSW1之后再启动LSW2。
+ 检验配置结果
使用`display stack`命令查看堆叠状态,输出信息如下:
```
[CORE]disp stack
Stack mode: Service-port
Stack topology type: Ring
Stack system MAC: 6012-3c9a-5ff0
MAC switch delay time: 10 min
Stack reserved VLAN: 4093
Slot of the active management port: --
Slot Role MAC Address Priority Device Type
-------------------------------------------------------------
0 Master 6012-3c9a-5ff0 200 S5735S-S24T4S-A
1 Standby 642c-acc1-5970 100 S5735S-S24T4S-A
```
输出展示了堆叠的状态信息包括堆叠模式、堆叠拓扑类型、堆叠系统MAC地址、MAC切换延迟时间、堆叠保留VLAN、激活管理端口的槽位、各个槽位的角色、MAC地址、优先级和设备类型。其中槽位0的Priority为200槽位1的Priority为100在竞争中槽位0最终会成为Master角色槽位1为Standby角色。按照顺序上电能够保证设备快速进入事先规定好的角色。
#para[
配置完成后两台设备将组成一个堆叠系统逻辑上看成一个设备标号为CORE称为核心集群。在后续的配置中将以CORE作为设备名称。
]
=== 配置核心集群的Eth-Trunk功能和接口IP地址
#para[
此步骤是要将核心集群与其他设备相连的物理链路聚合起来,以提高链路的带宽和可靠性。
]
+ 创建 Eth-Trunk1用于连接 AR1并加入 Eth-Trunk 成员接口。
```
[CORE] interface Eth-Trunk 1
[CORE-Eth-Trunk1] mode lacp
[CORE-Eth-Trunk1] quit
[CORE] interface GigabitEthernet 0/0/3
[CORE-GigabitEthernet0/0/3] Eth-Trunk 1
[CORE-GigabitEthernet0/0/3] quit
[CORE] interface GigabitEthernet 1/0/3
[CORE-GigabitEthernet1/0/3] Eth-Trunk 1
[CORE-GigabitEthernet1/0/3] quit
```
+ 创建 Eth-Trunk2用于连接 AR2并加入 Eth-Trunk 成员接口。
```
[CORE] interface Eth-Trunk 2
[CORE-Eth-Trunk2] mode lacp
[CORE-Eth-Trunk2] quit
[CORE] interface GigabitEthernet 0/0/4
[CORE-GigabitEthernet0/0/4] Eth-Trunk 2
[CORE-GigabitEthernet0/0/4] quit
[CORE] interface GigabitEthernet 1/0/4
[CORE-GigabitEthernet1/0/4] Eth-Trunk 2
[CORE-GigabitEthernet1/0/4] quit
```
+ 创建 Eth-Trunk3用于连接 FW1外侧并加入 Eth-Trunk 成员接口。
```
[CORE] interface Eth-Trunk 3
[CORE-Eth-Trunk3] mode lacp
[CORE-Eth-Trunk3] quit
[CORE] interface GigabitEthernet 0/0/8
[CORE-GigabitEthernet0/0/8] Eth-Trunk 3
[CORE-GigabitEthernet0/0/8] quit
[CORE] interface GigabitEthernet 1/0/8
[CORE-GigabitEthernet1/0/8] Eth-Trunk 3
[CORE-GigabitEthernet1/0/8] quit
```
+ 创建 Eth-Trunk4用于连接 FW1内侧并加入 Eth-Trunk 成员接口。
```
[CORE] interface Eth-Trunk 4
[CORE-Eth-Trunk4] mode lacp
[CORE-Eth-Trunk4] quit
[CORE] interface GigabitEthernet 0/0/9
[CORE-GigabitEthernet0/0/9] Eth-Trunk 4
[CORE-GigabitEthernet0/0/9] quit
[CORE] interface GigabitEthernet 1/0/9
[CORE-GigabitEthernet1/0/9] Eth-Trunk 4
[CORE-GigabitEthernet1/0/9] quit
```
+ 创建 Eth-Trunk5用于连接 FW2外侧并加入 Eth-Trunk 成员接口。
```
[CORE] interface Eth-Trunk 5
[CORE-Eth-Trunk5] mode lacp
[CORE-Eth-Trunk5] quit
[CORE] interface GigabitEthernet 0/0/10
[CORE-GigabitEthernet0/0/10] Eth-Trunk 5
[CORE-GigabitEthernet0/0/10] quit
[CORE] interface GigabitEthernet 1/0/10
[CORE-GigabitEthernet1/0/10] Eth-Trunk 5
[CORE-GigabitEthernet1/0/10] quit
```
+ 创建 Eth-Trunk6用于连接 FW2内侧并加入 Eth-Trunk 成员接口。
```
[CORE] interface Eth-Trunk 6
[CORE-Eth-Trunk6] mode lacp
[CORE-Eth-Trunk6] quit
[CORE] interface GigabitEthernet 0/0/11
[CORE-GigabitEthernet0/0/11] Eth-Trunk 6
[CORE-GigabitEthernet0/0/11] quit
[CORE] interface GigabitEthernet 1/0/11
[CORE-GigabitEthernet1/0/11] Eth-Trunk 6
[CORE-GigabitEthernet1/0/11] quit
```
=== 配置核心集群的VLAN功能
#para[
经过前面的配置核心集群上现在同时共存了2个VPN实例Private与Public。它们互相隔离表示内网与外网不能直接连通每个实例内又需要配置多个VLAN并在每个Eth接口上限制VLAN的出入借此来限制与不同用途的设备的连接。本步骤进行VLAN配置并为每个VLAN配置VLANIF接口的IP地址。
]
+ 创建 VLAN 并配置 VLANIF 接口。
```
[CORE] vlan batch 10 20 30 110 120 130
[CORE] interface Vlanif 10
[CORE-Vlanif10] ip address 192.168.10.1 24
[CORE-Vlanif10] quit
[CORE] interface Vlanif 20
[CORE-Vlanif20] ip address 192.168.20.1 24
[CORE-Vlanif20] quit
[CORE] interface Vlanif 30
[CORE-Vlanif30] ip address 192.168.30.1 24
[CORE-Vlanif30] quit
[CORE] interface Vlanif 110
[CORE-Vlanif110] ip address 192.168.110.1 24
[CORE-Vlanif110] quit
[CORE] interface Vlanif 120
[CORE-Vlanif120] ip address 192.168.120.1 24
[CORE-Vlanif120] quit
[CORE] interface Vlanif 130
[CORE-Vlanif130] ip address 192.168.130.1 24
[CORE-Vlanif130] quit
```
+ 配置 Eth-Trunk VLAN 允许列表
- 配置 Eth-Trunk1 允许 VLAN10。
```
[CORE] interface Eth-Trunk 1
[CORE-Eth-Trunk1] port link-type trunk
[CORE-Eth-Trunk1] port trunk allow-pass vlan 10
[CORE-Eth-Trunk1] quit
```
- 配置 Eth-Trunk2 允许 VLAN10。
```
[CORE] interface Eth-Trunk 2
[CORE-Eth-Trunk2] port link-type trunk
[CORE-Eth-Trunk2] port trunk allow-pass vlan 10
[CORE-Eth-Trunk2] quit
```
- 配置 Eth-Trunk3 允许 VLAN20。
```
[CORE] interface Eth-Trunk 3
[CORE-Eth-Trunk3] port link-type trunk
[CORE-Eth-Trunk3] port trunk allow-pass vlan 20
[CORE-Eth-Trunk3] quit
```
- 配置 Eth-Trunk4 允许 VLAN30。
```
[CORE] interface Eth-Trunk 4
[CORE-Eth-Trunk4] port link-type trunk
[CORE-Eth-Trunk4] port trunk allow-pass vlan 30
[CORE-Eth-Trunk4] quit
```
- 配置 Eth-Trunk5 允许 VLAN20。
```
[CORE] interface Eth-Trunk 5
[CORE-Eth-Trunk5] port link-type trunk
[CORE-Eth-Trunk5] port trunk allow-pass vlan 20
[CORE-Eth-Trunk5] quit
```
- 配置 Eth-Trunk6 允许 VLAN30。
```
[CORE] interface Eth-Trunk 6
[CORE-Eth-Trunk6] port link-type trunk
[CORE-Eth-Trunk6] port trunk allow-pass vlan 30
[CORE-Eth-Trunk6] quit
```
- 配置 Eth-Trunk7 允许 VLAN130。
```
[CORE] interface Eth-Trunk 7
[CORE-Eth-Trunk7] port link-type trunk
[CORE-Eth-Trunk7] port trunk allow-pass vlan 130
[CORE-Eth-Trunk7] quit
```
配置完成后,通过`display vlan`命令查看VLAN配置信息输出信息如下
```
[CORE]disp vlan
The total number of VLANs is: 8
--------------------------------------------------------------------------------
U: Up; D: Down; TG: Tagged; UT: Untagged;
MP: Vlan-mapping; ST: Vlan-stacking;
#: ProtocolTransparent-vlan; *: Management-vlan;
--------------------------------------------------------------------------------
VID Type Ports
--------------------------------------------------------------------------------
1 common UT:GE0/0/2(D) GE0/0/5(U) GE0/0/6(U) GE0/0/12(D)
GE0/0/13(U) GE0/0/14(D) GE0/0/15(D) GE0/0/16(D)
GE0/0/17(D) GE0/0/18(D) GE0/0/19(D) GE0/0/20(D)
GE0/0/21(D) GE0/0/22(D) GE0/0/23(D) GE0/0/25(D)
GE0/0/26(D) GE0/0/27(D) GE0/0/28(D) GE1/0/2(D)
GE1/0/6(U) GE1/0/12(U) GE1/0/13(U) GE1/0/14(D)
GE1/0/16(D) GE1/0/17(D) GE1/0/18(D) GE1/0/19(D)
GE1/0/20(D) GE1/0/21(D) GE1/0/22(D) GE1/0/23(D)
GE1/0/24(D) GE1/0/25(D) GE1/0/26(D) GE1/0/27(D)
GE1/0/28(D) Eth-Trunk1(U) Eth-Trunk2(U) Eth-Trunk10(D)
Eth-Trunk20(D)
10 common TG:GE1/0/12(U) Eth-Trunk1(U) Eth-Trunk2(U)
20 common UT:Eth-Trunk3(U) Eth-Trunk5(U)
TG:GE1/0/12(U)
30 common UT:Eth-Trunk4(U) Eth-Trunk6(U)
TG:GE1/0/12(U)
66 common UT:GE0/0/24(U)
TG:GE1/0/12(U)
110 common TG:GE0/0/5(U) GE1/0/6(U) GE1/0/12(U)
120 common TG:GE0/0/6(U) GE0/0/12(D) GE1/0/12(U)
130 common UT:GE1/0/5(U) GE1/0/15(D)
TG:GE1/0/12(U)
VID Status Property MAC-LRN Statistics Description
--------------------------------------------------------------------------------
1 enable default enable disable VLAN 0001
10 enable default enable disable VLAN 0010
20 enable default enable disable VLAN 0020
30 enable default enable disable VLAN 0030
66 enable default enable disable VLAN 0066
110 enable default enable disable VLAN 0110
120 enable default enable disable VLAN 0120
130 enable default enable disable VLAN 0130
```
输出中的信息与上文配置办法无异说明各个VLAN#footnote[其中的VLAN 66是后来配置的此处可忽略。]配置生效。
== 配置接入层
#para[
接入层的配置比较简单,仅涉及到 VLAN。
]
+ 配置 LSW3
```plaintext
<HUAWEI> system-view
[HUAWEI] sysname LSW3
[LSW3] vlan batch 110 // 创建 VLAN110
[LSW3] interface GigabitEthernet 0/0/1 // 配置连接 PC1 的接口为 Access 模式,加入 VLAN110
[LSW3-GigabitEthernet0/0/1] port link-type access
[LSW3-GigabitEthernet0/0/1] port default vlan 110
[LSW3-GigabitEthernet0/0/1] quit
[LSW3] interface GigabitEthernet 0/0/2 // 配置连接 PC2 的接口为 Access 模式,加入 VLAN110
[LSW3-GigabitEthernet0/0/2] port link-type access
[LSW3-GigabitEthernet0/0/2] port default vlan 110
[LSW3-GigabitEthernet0/0/2] quit
[LSW3] interface GigabitEthernet 0/0/3 // 配置连接 LSW1 的接口为 Trunk 模式,允许 VLAN110 通过
[LSW3-GigabitEthernet0/0/3] port link-type trunk
[LSW3-GigabitEthernet0/0/3] port trunk allow-pass vlan 110
[LSW3-GigabitEthernet0/0/3] quit
```
+ 配置 LSW4
```plaintext
<HUAWEI> system-view
[HUAWEI] sysname LSW4
[LSW4] vlan batch 120 // 创建 VLAN120
[LSW4] interface GigabitEthernet 0/0/1 // 配置连接 Asso 的接口为 Access 模式,加入 VLAN120
[LSW4-GigabitEthernet0/0/1] port link-type access
[LSW4-GigabitEthernet0/0/1] port default vlan 120
[LSW4-GigabitEthernet0/0/1] quit
[LSW4] interface GigabitEthernet 0/0/2 // 配置连接 Boss 的接口为 Access 模式,加入 VLAN120
[LSW4-GigabitEthernet0/0/2] port link-type access
[LSW4-GigabitEthernet0/0/2] port default vlan 120
[LSW4-GigabitEthernet0/0/2] quit
[LSW4] interface GigabitEthernet 0/0/3 // 配置连接 LSW1 的接口为 Trunk 模式,允许 VLAN120 通过
[LSW4-GigabitEthernet0/0/3] port link-type trunk
[LSW4-GigabitEthernet0/0/3] port trunk allow-pass vlan 120
[LSW4-GigabitEthernet0/0/3] quit
```
+ 配置 LSW5
```plaintext
<HUAWEI> system-view
[HUAWEI] sysname LSW5
[LSW5] vlan batch 130 // 创建 VLAN130
[LSW5] interface GigabitEthernet 0/0/2 // 配置连接 DataServer 的接口为 Access 模式,加入 VLAN130
[LSW5-GigabitEthernet0/0/2] port link-type access
[LSW5-GigabitEthernet0/0/2] port default vlan 130
[LSW5-GigabitEthernet0/0/2] quit
[LSW5] interface GigabitEthernet 0/0/3 // 配置连接 AP1 的接口为 Access 模式,加入 VLAN130
[LSW5-GigabitEthernet0/0/3] port link-type access
[LSW5-GigabitEthernet0/0/3] port default vlan 130
[LSW5-GigabitEthernet0/0/3] quit
[LSW5] interface GigabitEthernet 0/0/4 // 配置连接 LSW2 的接口为 Trunk 模式,允许 VLAN130 通过
[LSW5-GigabitEthernet0/0/4] port link-type trunk
[LSW5-GigabitEthernet0/0/4] port trunk allow-pass vlan 130
[LSW5-GigabitEthernet0/0/4] quit
```
== 配置出口网关的基本功能
#para[
出口网关即为AR1、AR2。在此步骤中首先配置路由器使用链路聚合接口核心交换机能够荣
]
+ AR1 上创建 Eth-Trunk2并加入成员接口。
```plaintext
[AR1] interface Eth-Trunk 2
[AR1-Eth-Trunk2] undo portswitch
[AR1-Eth-Trunk2] mode lacp-static
[AR1-Eth-Trunk2] quit
[AR1] interface GigabitEthernet 0/0/4
[AR1-GigabitEthernet0/0/4] Eth-Trunk 2
[AR1-GigabitEthernet0/0/4] quit
[AR1] interface GigabitEthernet 0/0/5
[AR1-GigabitEthernet0/0/5] Eth-Trunk 2
[AR1-GigabitEthernet0/0/5] quit
```
+ AR1 上配置 Dot1q 终结子接口及 IP 地址,并终结 VLAN10。
```plaintext
[AR1] interface Eth-Trunk 2.100
[AR1-Eth-Trunk2.100] ip address 192.168.10.2 24
[AR1-Eth-Trunk2.100] dot1q termination vid 10
[AR1-Eth-Trunk2.100] quit
```
+ AR2与AR1的配置几乎一模一样仅有IP地址的设置不同。在 AR2 上创建 Eth-Trunk4并加入成员接口。
```plaintext
[AR2] interface Eth-Trunk 2
[AR2-Eth-Trunk2] undo portswitch
[AR2-Eth-Trunk2] mode lacp-static
[AR2-Eth-Trunk2] quit
[AR2] interface GigabitEthernet 0/0/4
[AR2-GigabitEthernet0/0/4] Eth-Trunk 2
[AR2-GigabitEthernet0/0/4] quit
[AR2] interface GigabitEthernet 0/0/5
[AR2-GigabitEthernet0/0/5] Eth-Trunk 2
[AR2-GigabitEthernet0/0/5] quit
```
+ AR2 上配置 Dot1q 终结子接口及 IP 地址,并终结 VLAN10。
```plaintext
[AR2] interface Eth-Trunk 2.100
[AR2-Eth-Trunk2.100] ip address 192.168.10.3 24
[AR2-Eth-Trunk2.100] dot1q termination vid 10
[AR2-Eth-Trunk2.100] quit
```
=== 配置防火墙的基本功能
#para[
在此步骤中首先配置防火墙使用链路聚合接口然后配置接口的IP地址最后根据接口划分安全区域。
]
+ FW1 上配置接口与安全区域。
```plaintext
[FW1] interface Eth-Trunk 3 // 配置与 CORE 连接的接口及 IP 地址(外侧)
[FW1-Eth-Trunk3] ip address 192.168.20.2 24
[FW1-Eth-Trunk3] mode lacp-static
[FW1-Eth-Trunk3] quit
[FW1] interface GigabitEthernet 0/0/0 // 在 Eth-Trunk3 中加入成员接口
[FW1-GigabitEthernet0/0/0] Eth-Trunk 3
[FW1-GigabitEthernet0/0/0] quit
[FW1] interface GigabitEthernet 0/0/2 // 在 Eth-Trunk3 中加入成员接口
[FW1-GigabitEthernet0/0/2] Eth-Trunk 3
[FW1-GigabitEthernet0/0/2] quit
[FW1] interface Eth-Trunk 4 // 配置与 CORE 连接的接口及 IP 地址(内侧)
[FW1-Eth-Trunk4] ip address 192.168.30.2 24
[FW1-Eth-Trunk4] mode lacp-static
[FW1-Eth-Trunk4] quit
[FW1] interface GigabitEthernet 0/0/1 // 在 Eth-Trunk4 中加入成员接口
[FW1-GigabitEthernet0/0/1] Eth-Trunk 4
[FW1-GigabitEthernet0/0/1] quit
[FW1] interface GigabitEthernet 0/0/3 // 在 Eth-Trunk4 中加入成员接口
[FW1-GigabitEthernet0/0/3] Eth-Trunk 4
[FW1-GigabitEthernet0/0/3] quit
[FW1] interface Eth-Trunk 1 // 配置 FW1 与 FW2 连接的接口
[FW1-Eth-Trunk1] ip address 10.1.1.1 24
[FW1-Eth-Trunk1] mode lacp-static
[FW1-Eth-Trunk1] quit
[FW1] interface GigabitEthernet 0/0/4 // 在 Eth-Trunk1 中加入成员接口
[FW1-GigabitEthernet0/0/4] Eth-Trunk 1
[FW1-GigabitEthernet0/0/4] quit
[FW1] interface GigabitEthernet 0/0/5 // 在 Eth-Trunk1 中加入成员接口
[FW1-GigabitEthernet0/0/5] Eth-Trunk 1
[FW1-GigabitEthernet0/0/5] quit
[FW1] firewall zone trust
[FW1-zone-trust] add interface Eth-Trunk 4 // 将连接内网的 Eth-Trunk4 加入安全区域
[FW1-zone-trust] quit
[FW1] firewall zone untrust
[FW1-zone-untrust] add interface Eth-Trunk 3 // 将连接外网的 Eth-Trunk3 加入非安全区域
[FW1-zone-untrust] quit
[FW1] firewall zone dmz
[FW1-zone-dmz] add interface Eth-Trunk 1 // 将 FW1 与 FW2 之间的接口加入 DMZ 区域
[FW1-zone-dmz] quit
```
+ FW2 上配置接口与安全区域。
```plaintext
[FW2] interface Eth-Trunk 3 // 配置与 CORE 连接的接口及 IP 地址(外侧)
[FW2-Eth-Trunk3] ip address 192.168.20.3 24
[FW2-Eth-Trunk3] mode lacp-static
[FW2-Eth-Trunk3] quit
[FW2] interface GigabitEthernet 0/0/0 // 在 Eth-Trunk3 中加入成员接口
[FW2-GigabitEthernet0/0/0] Eth-Trunk 3
[FW2-GigabitEthernet0/0/0] quit
[FW2] interface GigabitEthernet 0/0/2 // 在 Eth-Trunk3 中加入成员接口
[FW2-GigabitEthernet0/0/2] Eth-Trunk 3
[FW2-GigabitEthernet0/0/2] quit
[FW2] interface Eth-Trunk 4 // 配置与 CORE 连接的接口及 IP 地址(内侧)
[FW2-Eth-Trunk4] ip address 192.168.30.3 24
[FW2-Eth-Trunk4] mode lacp-static
[FW2-Eth-Trunk4] quit
[FW2] interface GigabitEthernet 0/0/1 // 在 Eth-Trunk4 中加入成员接口
[FW2-GigabitEthernet0/0/1] Eth-Trunk 4
[FW2-GigabitEthernet0/0/1] quit
[FW2] interface GigabitEthernet 0/0/3 // 在 Eth-Trunk4 中加入成员接口
[FW2-GigabitEthernet0/0/3] Eth-Trunk 4
[FW2-GigabitEthernet0/0/3] quit
[FW2] interface Eth-Trunk 1 // 配置 FW2 与 FW1 连接的接口
[FW2-Eth-Trunk1] ip address 10.1.1.2 24
[FW2-Eth-Trunk1] mode lacp-static
[FW2-Eth-Trunk1] quit
[FW2] interface GigabitEthernet 0/0/4 // 在 Eth-Trunk1 中加入成员接口
[FW2-GigabitEthernet0/0/4] Eth-Trunk 1
[FW2-GigabitEthernet0/0/4] quit
[FW2] interface GigabitEthernet 0/0/5 // 在 Eth-Trunk1 中加入成员接口
[FW2-GigabitEthernet0/0/5] Eth-Trunk 1
[FW2-GigabitEthernet0/0/5] quit
[FW2] firewall zone trust
[FW2-zone-trust] add interface Eth-Trunk 4 // 将连接内网的 Eth-Trunk4 加入安全区域
[FW2-zone-trust] quit
[FW2] firewall zone untrust
[FW2-zone-untrust] add interface Eth-Trunk 3 // 将连接外网的 Eth-Trunk3 加入非安全区域
[FW2-zone-untrust] quit
[FW2] firewall zone dmz
[FW2-zone-dmz] add interface Eth-Trunk 1 // 将 FW2 与 FW1 之间的接口加入 DMZ 区域
[FW2-zone-dmz] quit
```
== 配置使内部网络互联互通
#para[
此处内网指与核心集群相连的重要设备即AR1、AR2、FW1、FW2。在此步骤中需要配置核心集群与AR1、AR2的连接使得核心集群能够连接路由器其次还要配置核心集群上两个不互通的VPN实例与FW1、FW2的连接使得两个VPN实例可以通过旁挂防火墙互通。
]
=== 在路由器上部署VRRP
#para[
在AR1、AR2上部署VRRP使得核心集群能够通过VRRP虚拟IP地址连接路由器。
]
- 配置AR1
```
[AR1] interface Eth-Trunk 2.100
[AR1-Eth-Trunk2.100] vrrp vrid 1 virtual-ip 192.168.10.100 //配置VRRP的虚拟IP地址
[AR1-Eth-Trunk2.100] vrrp vrid 1 priority 120 //提高RouterA的优先级使其成为Master
[AR1-Eth-Trunk2.100] quit
```
- 配置AR2
```
[AR2] interface Eth-Trunk 2.100
[AR2-Eth-Trunk2.100] vrrp vrid 1 virtual-ip 192.168.10.100 //配置VRRP的虚拟IP地址
[AR2-Eth-Trunk2.100] quit
```
=== 配置 AR1 和 AR2 的路由
#para[
+ AR1 上配置 OSPF。
]
```plaintext
[AR1] ospf 100 router-id 1.1.1.1
[AR1-ospf-100] area 0
[AR1-ospf-100-area-0.0.0.0] network 192.168.10.0 0.0.0.255 // 将连接 CORE 的网段发布到 OSPF 中
[AR1-ospf-100-area-0.0.0.0] quit
[AR1-ospf-100] quit
```
+ AR2 上配置 OSPF。
```plaintext
[AR2] ospf 100 router-id 2.2.2.2
[AR2-ospf-100] area 0
[AR2-ospf-100-area-0.0.0.0] network 192.168.10.0 0.0.0.255 // 将连接 CORE 的网段发布到 OSPF 中
[AR2-ospf-100-area-0.0.0.0] quit
[AR2-ospf-100] quit
```
=== 配置防火墙的路由
+ FW1 上配置静态路由。
```plaintext
[FW1] ip route-static 0.0.0.0 0.0.0.0 192.168.20.1 // 对于上行流量,缺省路由下一跳为 CORE 的 Public 接口 VLANIF20 的 IP 地址
[FW1] ip route-static 192.168.110.0 255.255.255.0 192.168.30.1 // 对于下行流量,目的地址为 VLAN110 网络,下一跳为 CORE 的 Private 接口 VLANIF30 的 IP 地址
[FW1] ip route-static 192.168.120.0 255.255.255.0 192.168.30.1 // 对于下行流量,目的地址为 VLAN120 网络,下一跳为 CORE 的 Private 接口 VLANIF30 的 IP 地址
[FW1] ip route-static 192.168.130.0 255.255.255.0 192.168.30.1 // 对于下行流量,目的地址为 VLAN130 网络,下一跳为 CORE 的 Private 接口 VLANIF30 的 IP 地址
```
+ FW2 上配置静态路由。
```plaintext
[FW2] ip route-static 0.0.0.0 0.0.0.0 192.168.20.1 // 对于上行流量,缺省路由下一跳为 CORE 的 Public 接口 VLANIF20 的 IP 地址
[FW2] ip route-static 192.168.110.0 255.255.255.0 192.168.30.1 // 对于下行流量,目的地址为 VLAN110 网络,下一跳为 CORE 的 Private 接口 VLANIF30 的 IP 地址
[FW2] ip route-static 192.168.120.0 255.255.255.0 192.168.30.1 // 对于下行流量,目的地址为 VLAN120 网络,下一跳为 CORE 的 Private 接口 VLANIF30 的 IP 地址
[FW2] ip route-static 192.168.130.0 255.255.255.0 192.168.30.1 // 对于下行流量,目的地址为 VLAN130 网络,下一跳为 CORE 的 Private 接口 VLANIF30 的 IP 地址
```
=== 配置核心集群的路由
#para[
核心集群上路由配置比较复杂涉及到两个VPN实例分别是Public和Private。Public用于连接路由器Private用于连接防火墙。在此步骤中需要配置核心集群上的路由使得核心集群能够连接路由器和防火墙。配置时需要仔细对照网络拓扑表确保路由配置正确。
]
+ CORE 上创建 VPN 实例 Public将连接路由器的接口和连接防火墙上行口的接口绑定到 Public。
```plaintext
[CORE] ip vpn-instance Public // 创建 Public
[CORE-vpn-instance-Public] ipv4-family
[CORE-vpn-instance-Public-af-ipv4] route-distinguisher 100:2
[CORE-vpn-instance-Public-af-ipv4] vpn-target 222:2 both
[CORE-vpn-instance-Public-af-ipv4] quit
[CORE-vpn-instance-Public] quit
[CORE] interface Vlanif 10
[CORE-Vlanif10] ip binding vpn-instance Public // 将 CORE 连接路由器的接口 VLANIF10 绑定至 Public
[CORE-Vlanif10] ip address 192.168.10.1 24 // 将接口绑定到 Public 时,接口上的 IP 地址会被删除,需要重新配置 IP 地址
[CORE-Vlanif10] quit
[CORE] interface Vlanif 20
[CORE-Vlanif20] ip binding vpn-instance Public // 将 CORE 连接防火墙上行口的接口 VLANIF20 绑定至 Public
[CORE-Vlanif20] ip address 192.168.20.1 24 // 将接口绑定到 Public 时,接口上的 IP 地址会被删除,需要重新配置 IP 地址
[CORE-Vlanif20] quit
```
+ 对于上行流量,在 Public 中配置静态路由,路由下一跳指向路由器 VRRP 虚拟 IP。
```plaintext
[CORE] ip route-static vpn-instance Public 0.0.0.0 0.0.0.0 192.168.10.100 // 缺省路由下一跳指向 VRRP 虚拟 IP
```
3. 对于下行流量,在 Public 中配置静态路由,路由下一跳指向防火墙上行 VRRP 1 的虚拟 IPVRID1
```plaintext
[CORE] ip route-static vpn-instance Public 192.168.110.0 255.255.255.0 192.168.20.2 // 目的地址为 VLAN110 网络,下一跳指向 FW1 的上行接口
[CORE] ip route-static vpn-instance Public 192.168.120.0 255.255.255.0 192.168.20.2 // 目的地址为 VLAN120 网络,下一跳指向 FW1 的上行接口
[CORE] ip route-static vpn-instance Public 192.168.130.0 255.255.255.0 192.168.20.2 // 目的地址为 VLAN130 网络,下一跳指向 FW1 的上行接口
```
+ 对于下行流量,在 CORE AR1、AR2 之间运行 OSPF 协议,用于 AR1、AR2 学习到业务网段的回程路由信息。
```plaintext
[CORE] ospf 100 router-id 1.1.1.1 vpn-instance Public
[CORE-ospf-100] area 0
[CORE-ospf-100-area-0.0.0.0] network 192.168.10.0 0.0.0.255 // 将连接 AR1、AR2 的网段发布到 OSPF 中
[CORE-ospf-100-area-0.0.0.0] quit
[CORE-ospf-100] import-route static // 在 OSPF 中引入静态路由
[CORE-ospf-100] quit
```
+ 对于上行流量,在 CORE 上创建 VPN 实例 Private将连接业务网络的接口和连接防火墙下行的接口绑定到 PrivatePrivate 的缺省路由下一跳指向防火墙下行 VRRP 虚拟 IPVRID2
```plaintext
[CORE] ip vpn-instance Private // 创建 Private
[CORE-vpn-instance-Private] ipv4-family
[CORE-vpn-instance-Private-af-ipv4] route-distinguisher 100:1
[CORE-vpn-instance-Private-af-ipv4] vpn-target 111:1 both
[CORE-vpn-instance-Private-af-ipv4] quit
[CORE-vpn-instance-Private] quit
[CORE] interface Vlanif 110
[CORE-Vlanif110] ip binding vpn-instance Private // 将 CORE 连接 VLAN110 的接口 VLANIF110 绑定至 Private
[CORE-Vlanif110] ip address 192.168.110.1 24 // 将接口绑定到 Private 时,接口上的 IP 地址会被删除,需要重新配置 IP 地址
[CORE-Vlanif110] quit
[CORE] interface Vlanif 120
[CORE-Vlanif120] ip binding vpn-instance Private // 将 CORE 连接 VLAN120 的接口 VLANIF120 绑定至 Private
[CORE-Vlanif120] ip address 192.168.120.1 24 // 将接口绑定到 Private 时,接口上的 IP 地址会被删除,需要重新配置 IP 地址
[CORE-Vlanif120] quit
[CORE] interface Vlanif 130
[CORE-Vlanif130] ip binding vpn-instance Private // 将 CORE 连接 VLAN130 的接口 VLANIF130 绑定至 Private
[CORE-Vlanif130] ip address 192.168.130.1 24 // 将接口绑定到 Private 时,接口上的 IP 地址会被删除,需要重新配置 IP 地址
[CORE-Vlanif130] quit
[CORE] interface Vlanif 30
[CORE-Vlanif30] ip binding vpn-instance Private // 将 CORE 连接防火墙下行的接口 VLANIF30 绑定至 Private
[CORE-Vlanif30] ip address 192.168.30.1 24 // 将接口绑定到 Private 时,接口上的 IP 地址会被删除,需要重新配置 IP 地址
[CORE-Vlanif30] quit
```
+ Private 中配置缺省路由,下一跳指向防火墙下行 VRRP 2 的虚拟 IPVRID2
```plaintext
[CORE] ip route-static vpn-instance Private 0.0.0.0 0.0.0.0 192.168.30.2 // 缺省路由下一跳指向 FW1 的下行接口
```
== 阶段性检验
#para[
上面的配置完成后进行一个阶段性检验。配置PC1的IP地址为`192.168.110.10/24`网关为核心集群上VPN实例Private内的Vlanif110接口地址`192.168.110.1`然后ping AR1、AR2的VRRP虚拟IP地址`192.168.10.100`,是可以通的,如图@check_point1。如果不能则逐级ping查找问题所在。
]
#figure(image("阶段性检验1.jpg",format:"jpg",fit:"stretch",width: 100%),caption:"阶段性检验1")<check_point1>
== 配置其他功能
=== 配置出口网关的BFD功能
#para[
配置 AR1 AR2 之间的 BFD 功能,用于快速检测链路故障并触发 OSPF 路由收敛。
]
+ 配置全局 BFD 功能。
```plaintext
[AR1] bfd // 配置全局 BFD 功能并进入全局 BFD 视图
[AR1-bfd] quit
```
```plaintext
[AR2] bfd // 配置全局 BFD 功能并进入全局 BFD 视图
[AR2-bfd] quit
```
+ AR1 上配置 OSPF BFD 特性。
```plaintext
[AR1] ospf 100 // 进入 OSPF 视图
[AR1-ospf-100] bfd all-interfaces enable // 打开 OSPF BFD 特性的开关,建立 BFD 会话
[AR1-ospf-100] quit
```
+ AR2 上配置 OSPF BFD 特性。
```plaintext
[AR2] ospf 100 // 进入 OSPF 视图
[AR2-ospf-100] bfd all-interfaces enable // 打开 OSPF BFD 特性的开关,建立 BFD 会话
[AR2-ospf-100] quit
```
+ 配置 BFD 参数。
```plaintext
[AR1-ospf-100] bfd all-interfaces min-rx-interval 1000 min-tx-interval 1000 detect-multiplier 3
[AR2-ospf-100] bfd all-interfaces min-rx-interval 1000 min-tx-interval 1000 detect-multiplier 3
```
+ 验证 BFD 会话。
```plaintext
[AR1] display ospf bfd session all
[AR2] display ospf bfd session all
```
该命令在AR1上得到以下输出
```
[AR1]disp ospf bfd session all
OSPF Process 100 with Router ID 2.2.2.2
Area 0.0.0.0 interface 192.168.10.3(Eth-Trunk2.100)'s BFD Sessions
NeighborId:1.1.1.1 AreaId:0.0.0.0 Interface:Eth-Trunk2.100
BFDState:up rx :1000 tx :1000
Multiplier:3 BFD Local Dis:8198 LocalIpAdd:192.168.10.3
RemoteIpAdd:192.168.10.1 Diagnostic Info:No diagnostic information
NeighborId:3.3.3.3 AreaId:0.0.0.0 Interface:Eth-Trunk2.100
BFDState:up rx :1000 tx :1000
Multiplier:3 BFD Local Dis:8197 LocalIpAdd:192.168.10.3
RemoteIpAdd:192.168.10.2 Diagnostic Info:No diagnostic information
```
注意其中的`BFDStat`字段,显示为`up`,表示 BFD 会话建立成功。
=== 配置防火墙的双机热备
#para[
在防火墙上配置双机热备功能主备备份模式确保高可用性。FW1 作为 MasterFW2 作为 Slave。
]
+ FW1 上配置双机热备FW1 在备份组中作为 Master。
```plaintext
[FW1] interface Eth-Trunk 3
[FW1-Eth-Trunk3] vrrp vrid 1 virtual-ip 192.168.20.2 24 active
[FW1-Eth-Trunk3] quit
[FW1] interface Eth-Trunk 4
[FW1-Eth-Trunk4] vrrp vrid 2 virtual-ip 192.168.30.2 24 active
[FW1-Eth-Trunk4] quit
[FW1] hrp interface Eth-Trunk 1 remote 10.1.1.2 // 配置心跳口,并启用双机热备
[FW1] hrp enable
```
+ FW2 上配置双机热备FW2 在备份组中作为 Slave。
```plaintext
[FW2] interface Eth-Trunk 3
[FW2-Eth-Trunk3] vrrp vrid 1 virtual-ip 192.168.20.2 24 standby
[FW2-Eth-Trunk3] quit
[FW2] interface Eth-Trunk 4
[FW2-Eth-Trunk4] vrrp vrid 2 virtual-ip 192.168.30.2 24 standby
[FW2-Eth-Trunk4] quit
[FW2] hrp interface Eth-Trunk 1 remote 10.1.1.1 // 配置心跳口,并启用双机热备
[FW2] hrp enable
```
配置好之后保存配置将两台设备全部断电关机。按照FW1先、FW2后的顺序开机防火墙开机较久约5分钟可通过风扇声音判断声音突然由大变小表示开机完成应该可以观察到防火墙Web主页中的主备状态
#figure(image("主备备份(主).png",format:"png",fit:"stretch",width: 80%),caption:"防火墙双机热备FW1")<FW1_hr>
#figure(image("主备备份(备).png",format:"png",fit:"stretch",width: 80%),caption:"防火墙双机热备FW2")<FW2_hr>
=== 配置DHCP服务器
#para[
DHCP服务器一般配置在接入层上但本实验拓扑图较为简单所以在核心集群上配置DHCP服务器 VLANIF110 VLANIF120 接口下的客户端分配 IP 地址和相关网络参数。
]
+ 配置 VLANIF110 接口的 DHCP 地址池
- 配置 VLANIF110 接口下的客户端从接口地址池中获取 IP 地址和相关网络参数。
```plaintext
[CORE] interface vlanif 110
[CORE-Vlanif110] dhcp select interface
[CORE-Vlanif110] dhcp server gateway-list 192.168.110.1
[CORE-Vlanif110] dhcp server lease day 30
[CORE-Vlanif110] dhcp server dns-list 192.168.130.10 //内网中的DNS服务器地址
[CORE-Vlanif110] quit
```
+ 配置 VLANIF120 接口的 DHCP 地址池
- 配置 VLANIF120 接口下的客户端从接口地址池中获取 IP 地址和相关网络参数。
```
[CORE] interface vlanif 120
[CORE-Vlanif120] dhcp select interface
[CORE-Vlanif120] dhcp server gateway-list 192.168.120.1
[CORE-Vlanif120] dhcp server lease day 60 // 老板一般会当得比员工久
[CORE-Vlanif120] dhcp server dns-list 192.168.130.10
[CORE-Vlanif120] quit
```
#para[
配置完成之后配置PC1、PC2为自动获取IP地址的方式还可配置自动获取DNS地址查看 DHCP 地址池信息:
]
- 使用 `display ip pool` 命令查看 DHCP 地址池的配置和状态。
```plaintext
[CORE] display ip pool
-------------------------------------------------------------------------------------
Pool-name : Vlanif110
Pool-No : 0
Lease : 1 Days 0 Hours 0 Minutes
Position : Interface
Status : Unlocked
Gateway-0 : 192.168.110.1
Network : 192.168.110.0
Mask : 255.255.255.0
VPN instance : Private
Conflicted address recycle interval: -
Address Statistic: Total :253 Used :2
Idle :251 Expired :0
Conflict :0 Disabled :0
```
注意到`Used`字段中变成2。此时在任一台机器上查看IP地址和DNS地址可以看到被分配的地址
#figure#figure(image("dhcp_dns.jpg",format:"jpg",fit:"stretch",width: 100%),caption:"PC1自动获取IP地址和DNS服务器地址")<dhcp_dns>
=== 配置STP以消除网络中的环路
#para[
逻辑拓扑图@logic_topo 有更完整的版本:
]
#figure(image("无环路.png",format:"png",fit:"stretch",width: 60%),caption:"逻辑拓扑图(完整)")<no_halo>
#para[
分析逻辑拓扑图发现此网络基本呈树形有且仅有核心集群与FW1、FW2之间组成的环。因此只需要在核心集群、防火墙上配置 STP就可以消除网络中的环路不需要RSTP、MSTP等较复杂的协议。具体来说以阻塞 FW2 连接Private的端口Eth4为目的配置STP协议。
]
+ CORE 上启用 STP 并配置优先级。
```plaintext
[CORE] stp enable // 启用 STP 协议
[CORE] stp mode stp // 配置 STP 模式为标准 STP
[CORE] stp priority 0 // 设置 CORE 的 STP 优先级为 0确保 CORE 成为根桥)
[CORE] quit
```
+ FW1 上启用 STP 并配置优先级。
```plaintext
[FW1] stp enable // 启用 STP 协议
[FW1] stp mode stp // 配置 STP 模式为标准 STP
[FW1] stp priority 4096 // 设置 FW1 的 STP 优先级为 4096
[FW1] quit
```
+ FW2 上启用 STP 并配置优先级。
```plaintext
[FW2] stp enable // 启用 STP 协议
[FW2] stp mode stp // 配置 STP 模式为标准 STP
[FW2] stp priority 8192 // 设置 FW2 的 STP 优先级为 8192
[FW2] quit
```
+ FW2 上阻塞指定端口
```plaintext
[FW2] interface Eth-Trunk 4
[FW2-Eth-Trunk4] stp disable // 禁用 STP 以阻塞 Eth4 端口
[FW2-Eth-Trunk4] quit
```
=== 为出口网关配置NAT
#para[
由于内网用户有上网需求,所以需要进行地址转换。这一步骤在 AR1 AR2 上配置 NAT 功能包括地址池、ACL、静态映射以及 FTP ALG 功能。
]
+ 配置地址池和 ACL
- AR1 上配置地址池:
```plaintext
[AR1] nat address-group 1 172.163.1.10 172.163.1.252
```
- AR2 上配置地址池:
```plaintext
[AR2] nat address-group 1 172.163.3.10 172.163.3.252
```
- AR1 AR2 上创建 ACL匹配需要上网的内网段
```plaintext
[AR1] acl 2000
[AR1-acl-basic-2000] rule permit source 192.168.110.0 0.0.0.255
[AR1-acl-basic-2000] rule permit source 192.168.120.0 0.0.0.255
[AR1-acl-basic-2000] quit
```
```
[AR2] acl 2000
[AR2-acl-basic-2000] rule permit source 192.168.110.0 0.0.0.255
[AR2-acl-basic-2000] rule permit source 192.168.120.0 0.0.0.255
[AR2-acl-basic-2000] quit
```
- AR1 AR2 的路由出口引用 ACL 2000使匹配的网段中的地址可以使用地址池中的地址进行 NAT 转换:
```plaintext
[AR1] int g0/0/2
[AR1-GigabitEthernet0/0/2] nat outbound 2000 address-group 1 no-pat
[AR1-GigabitEthernet0/0/2] quit
```
```
[AR2] int g0/0/3
[AR2-GigabitEthernet0/0/3] nat outbound 2000 address-group 1 no-pat
[AR2-GigabitEthernet0/0/3] quit
```
+ 配置 NAT 静态映射
- AR1 上配置 NAT 静态映射,实现外网用户通过预留的公网 IP 地址 172.163.1.9 访问内部 FTP/Web 服务器:
```plaintext
[AR1] int g0/0/2
[AR1-GigabitEthernet0/0/2] nat static protocol tcp global 172.163.1.9 21 inside 192.168.130.10 21
[AR1-GigabitEthernet0/0/2] nat static protocol tcp global 172.163.1.9 80 inside 192.168.130.10 80
[AR1-GigabitEthernet0/0/2] quit
```
- AR2 上配置 NAT 静态映射,实现外网用户通过预留的公网 IP 地址 172.163.3.9 访问内部 FTP/Web 服务器:
```plaintext
[AR2] int g0/0/3
[AR2-GigabitEthernet0/0/3] nat static protocol tcp global 172.163.3.9 21 inside 192.168.130.10 21
[AR2-GigabitEthernet0/0/3] nat static protocol tcp global 172.163.3.9 80 inside 192.168.130.10 80
[AR2-GigabitEthernet0/0/3] quit
```
+ 开启 FTP NAT ALG 功能
```plaintext
[AR1] nat alg ftp enable
```
```
[AR2] nat alg ftp enable
```
4. 查看 NAT 转换和静态映射的结果
+ AR1 AR2 上查看 NAT 转换和静态映射的结果:
```plaintext
[AR1] display nat address-group 1
[AR1] display nat static
```
```
[AR2] display nat address-group 1
[AR2] display nat static
```
结果如@ar1nat @ar2nat 所示(见下页):
#figure(image("AR1-NAT配置结果-截图.jpg",format:"jpg",fit:"stretch",width: 80%),caption:"AR1 NAT配置结果")<ar1nat>
#figure(image("AR1-NAT配置结果-截图.jpg",format:"jpg",fit:"stretch",width: 80%),caption:"AR1 NAT配置结果")<ar2nat>
=== 防火墙的工作时间段切换
#para[
公司规定员工办公室工作时间内不能访问外网。因此,需要在防火墙上配置对应的安全策略,即工作时间段内`trust`不能访问`untrust`区域,策略配置如下:
]
#figure(image("do_not_play_policy.png",format:"png",fit:"stretch",width: 90%),caption:"配置非工作时间段内不能访问外网")<do_not_play>
=== 配置端口安全
#para[
LSW4 上为连接到 Boss 设备的接口配置端口安全,以确保只有特定的 MAC 地址可以访问该端口。
]
+ 进入连接到 Boss 设备的接口配置模式。
```plaintext
[LSW4] interface GigabitEthernet0/0/2
```
+ 启用端口安全功能。
```plaintext
[LSW4-GigabitEthernet0/0/2] port-security enable
```
+ 配置粘性 MAC 地址,以便动态学习并绑定第一个连接到该端口的设备的 MAC 地址。
```plaintext
[LSW4-GigabitEthernet0/0/2] port-security mac-address sticky
```
+ 设置该端口允许的最大 MAC 地址数量为 1确保只有一个设备可以连接到该端口。
```plaintext
[LSW4-GigabitEthernet0/0/2] port-security max-mac-num 1
```
=== 配置Web服务器与DNS服务器
#para[
在个人笔记本电脑上配置服务器。选择Apache24作为Web服务器选择BIND 9作为DNS服务器。Apache的配置十分简单而BIND的具体配置十分复杂不是重点在此不再展开。
]
=== 配置无线路由器
#para[
初始化AP然后以无线网络连接到它的配置界面`tplogin.cn`TP-Link AX3000。随后选择桥接模式即可。
]
#para[
理论成立但实际不可行。经测试此AP在选取桥接模式后也无法真正地担任交换机的功能两个连接同网段设备的端口间互ping不通。推测在工程环境下只能作为路由器使用。而拓扑图中已经没有多余的路由器位置。即使有也不具有适合此AP的功能性。所以不再继续配置此AP。
]
== 实验后验收
#para[
检查以下项目来验证整个网络的功能:
]
+ 内网主机能够通过DHCP获取到IP地址#box(
text(font: ("Times LT Pro","FZXiaoBiaoSong-B05"),fill: luma(240), weight:"bold", "先前已验证"),
fill:green,
inset: (x: 3pt, y: 0pt),
outset: (y: 3pt),
radius: 2pt,)
// + 内网主机之间互相ping通PC1和老板、PC2和Asso
+ 内网主机之间可以互相通信;
+ 内网主机可以通过IP地址访问Web服务器
// + 内网主机可以通过域名www.construction.com访问Web服务器
+ 内网主机可以通过域名访问Web服务器
+ 外网主机可以通过外网地址访问内网Web服务器
//+ 内网主机可以ping通外网主机抓包显示源地址是经过转换的地址
+ 内网主机可以访问外网;
+ 检验防火墙安全策略;
+ 防火墙主备备份;#box(
text(font: ("Times New Roman","Noto Sans CJK SC"),fill: luma(240), weight:"bold", "先前已验证"),
fill:green,
inset: (x: 3pt, y: 0pt),
outset: (y: 3pt),
radius: 2pt,)
+ 检验出口网关双机热备份/BFD快速切换
+ 检验端口安全;
其中,第一项与第八项先前已经验证生效,后续不再专门验收。
=== 内网通信
#para[
检查内网主机之间是否可以互相ping通。这里以PC1和Boss、PC2和Asso通信为例
]
#figure(image("2.PC1-ping老板.jpg",format: "jpg",width: 50%,fit:"stretch"),caption:"PC1 ping 通 Boss")
#figure(image("3.PC2-ping-Asso.jpg",format: "jpg",width: 50%,fit:"stretch"),caption:"PC2 ping 通 Asso")
=== 内网访问Web服务器
#para[
使用主机Asso经由IP地址192.168.130.10访问Web服务器
#figure(image("4.Asso访问web-通过ip.jpg",format: "jpg",width: 100%,fit:"stretch"),caption:"Asso通过IP访问Web服务器")
通过域名www.construction.com访问服务器
#figure(image("5.Asso访问web-通过域名.jpg",format: "jpg",width: 100%,fit:"stretch"),caption:"Asso通过访问Web服务器")
]
=== 外网访问Web服务器
#para[
使用外网主机(地址为`172.163.5.1`通过服务器的公网IP访问服务器
#figure(image("外网主机访问web-通过转换后地址.png",format: "png",width: 100%,fit:"stretch"),caption:"Asso通过访问Web服务器")
这还可以说明防火墙有关内外网之间的区域限制策略设置无误即Untrust区域可以访问DMZ区域DMZ区域也可以访问Untrust区域。
]
=== 内外网访问系列验证、NAT验证与出口网关BFD验证
#para[
使用内网主机PC1对外网主机进行长ping然后再外网主机上开启抓包。途中使用`shutdown`命令断开AR1与CORE的连接。在PC1上观察长ping是否断开在外网主机上观察抓包结果中源地址是否是经过NAT的转换以及时间序列上相差多少。
运行过程如下:
#figure(image("路由器双机热备份.jpg",format: "jpg",width: 100%,fit:"stretch"),caption:"长ping不断")<ping_s>
@ping_s 中可以观察到:
- 长ping没有断开
- `shutdown`端口之前,`tracert`命令返回的路径经过了AR1`192.168.10.3`
- `shutdown`端口之前,`tracert`命令返回的路径变为经过AR2`192.168.10.2`
进一步分析需要查看抓包结果。抓包结果如下:
#figure(image("长ping不断.png",format: "png",width: 100%,fit:"stretch"),caption:"长ping不断")<ping_t>
观察@ping_t,靠上方红框内的源地址均为`172.163.1.10`即AR1经过NAT转换后的外网网关地址这说明AR1上的NAT生效在第8到9秒之间外网主机捕获到一个ARP报文询问它的IP地址这可能是AR2从备份状态变为了工作状态发出ARP询问。随后的第9.7s内网主机的下一个ping报文到来。由于此次报文到达与上次到达间隔仅为1s恰好是ping程序发送请求的时间间隔由此可见PC1上的长ping丝毫没有受到影响。在这之后ping的源地址均为`172.163.3.10`即AR2经过NAT转换后的外网网关地址这说明AR2上的NAT生效。
凭此抓包结果即可验证数个配置项目。
]
=== 防火墙安全策略系列验证
#para[
此处主要验证几条“禁止”的防火墙策略。
1. 验证非工作时间段职员办公室PC1、PC2无法访问外网
以PC1为例。验证这条策略需要查看工作时间、非工作时间下PC1是否能ping通外网主机。
首先,在工作时间下,查看防火墙策略的命中次数:
#figure(image("防火墙工作时段时间截图.png",format: "png",width: 100%,fit:"stretch"),caption:"防火墙工作时段")<work>
#figure(image("防火墙工作时段策略命中次数截图ping前.png",format: "png",width: 100%,fit:"stretch"),caption:"防火墙工作时段策略命中次数截图ping前")<work_1>
然后用PC1 ping外网发现能够ping通。观察策略命中次数
#figure(image("防火墙工作时段策略命中次数截图ping后.png",format: "png",width: 100%,fit:"stretch"),caption:"防火墙工作时段策略命中次数截图ping后")<work_2>
注意到命中次数增加。
首先,在非工作时间下,查看防火墙策略的命中次数:
#figure(image("防火墙非工作时段时间截图.png",format: "png",width: 100%,fit:"stretch"),caption:"防火墙非工作时段")<nwork>
#figure(image("防火墙非工作时段策略命中次数截图ping前.png",format: "png",width: 100%,fit:"stretch"),caption:"防火墙非工作时段策略命中次数截图ping前")<nwork_1>
然后用PC1 ping外网发现能够ping通。观察策略命中次数
#figure(image("防火墙非工作时段策略命中次数截图ping后.png",format: "png",width: 100%,fit:"stretch"),caption:"防火墙非工作时段策略命中次数截图ping后")<nwork_2>
注意到命中次数增加。
2. 验证外网ping不通内网trust区域
在外网主机上ping内网PC1发现无法ping通
#figure(image("外网ping不通内网.png",format: "png",width: 70%,fit:"stretch"),caption:"Untrust区域无法访问Trust区域")<unt_t>
防火墙上的验证与上面的步骤类似,此处不再展示。
]
=== 端口安全验证
#para[
将Boss电脑取下将其网线接到外网主机上。在外网主机上配置自动获取IP地址然后运行ipconfig /renew命令后依然无法获取到IP地址。
#figure(image("外网主机接boss网.png",format: "png",width: 50%,fit:"stretch"),caption:"配置外网主机为自动获取IP地址")
#figure(image("外网主机无法自动获取IP.png",format: "png",width: 70%,fit:"stretch"),caption:"外网主机无法自动获取IP地址")
此外还可通过手动设置外网主机IP地址为192.168.120.25/24即192.168.120.0/24网段中除Vlanif 120与特殊IP地址外的任一IP地址来构成直连网络。但即便如此ping Vlanif 120还是会发现无法ping通。
至此,所有配置验证结束。
]
= 实验总结
== 内容总结
#para[
本次实验的主要目标是设计和实现一个包含局域网和广域网的中型网络涵盖了从网络规划、方案设计、设备选型与采购、硬件安装与配置、软件安装与配置、系统测试与联调、工程验收等完整的组网工程流程。实验通过模拟第三建筑公司总部大楼的网络建设需求详细展示了如何通过多种先进技术如VRRP、链路聚合、堆叠技术、VLAN、防火墙旁挂等来构建一个高效、安全、稳定的网络环境。实验首先进行了详细的需求分析明确了网络覆盖、性能、安全、管理、扩展、服务器和存储、终端设备等方面的需求并制定了相应的项目交付要求和预算。随后实验采用了多种网络技术来满足需求包括虚拟路由冗余协议VRRP确保出口网关的高可用性链路聚合技术Eth-trunk提升网络带宽和链路可靠性堆叠技术用于核心交换机的冗余和扩展VLAN技术用于划分不同部门的安全区域防火墙旁挂系统通过双机热备技术确保网络安全防护的连续性。
实验设计了详细的网络拓扑图并通过设备连接表展示了各个设备之间的连接关系。核心交换机、路由器、防火墙、接入层交换机等设备的连接和配置都严格按照拓扑图进行。实验详细配置了核心交换机的堆叠系统、Eth-Trunk功能、VLAN功能等确保核心层的高效管理和扩展性。通过堆叠技术两台核心交换机在逻辑上形成一个设备提升了网络的冗余性和可靠性。接入层的配置相对简单主要涉及VLAN的划分和接入层交换机的配置确保终端设备能够正确接入网络并实现部门间的隔离。出口网关的VRRP功能和防火墙的双机热备功能也得到配置确保出口网关的高可用性和网络安全防护的连续性。此外实验还配置了防火墙的安全策略限制非工作时间的网络访问并通过DHCP服务器为VLAN内的终端设备自动分配IP地址同时配置了NAT功能确保内网用户能够通过出口网关访问外网资源。
实验通过多个阶段的验证确保网络的各项功能正常运行。包括内网主机之间的通信、内网主机访问Web服务器、外网主机访问内网服务器、防火墙安全策略的验证、出口网关的双机热备验证等。
]
== 心得感悟
=== 组长的心得感悟
#para[
本次实验自由度较大时间跨度长所以我选择了比较有挑战性的设计方案也因此实现难度较大。在配置的过程中遇到了很多困难但也让我对网络设备的运行机制有了更深的理解。从需求分析到方案设计再到设备配置和测试验收每一个环节都需要严谨的态度和细致的操作。实验中的每一步配置都充满了挑战尤其是在核心交换机的堆叠配置、防火墙的双机热备、NAT的配置等方面我遇到了不少困难但也因此积累了宝贵的实践经验。
最“磨人”的当属防火墙配置问题。由于防火墙旁挂需要第二台防火墙所以我们启用了全新的防火墙又由于机柜上的防火墙的MGMT网口有些许破损我们启用了2台新的防火墙而这给我的调试带来了灾难性后果即无论如何配置均不生效。最后经教员指导排查发现是防火墙未激活的问题。遂将防火墙搬到寝室内进行联网激活
#figure(image("激活1.jpg",format: "jpg",width: 70%,fit:"stretch"),caption:"搬运防火墙")
#figure(image("激活2.jpg",format: "jpg",width: 70%,fit:"stretch"),caption:"激活防火墙")
在将防火墙联网激活之后,一切豁然开朗,之前的问题全数解决!这一过程虽然“磨人”,但也让我深刻体会到设备初始化与激活的重要性,以及在实际工程中细节决定成败的道理。
此外,实验还让我意识到网络安全的重要性。在防火墙策略的配置和端口安全的设置上,必须严格把控,确保网络的安全性和稳定性。通过本次实验,我不仅掌握了多种网络技术的应用,还学会了如何在工程中协调各方资源,确保项目的顺利实施。总的来说,本次实验极大地提升了我的网络工程能力,为我未来的职业发展奠定了坚实的基础。
]
=== 一把手的心得感悟
#para[
完成这次组网实验是一次难忘的体验,在团队的共同努力下,我们成功完成了实验的各项任务。
在实验中我负责了出口路由器AR1、AR2的NAT地址转换配置。在该配置中我们首先为内网办公区域配置了公网的动态地址池当内网用户访问外网时其内网地址将会转换为地址池中第一个空闲的公网地址从而隐藏内网用户的IP地址。然后我们为内网的Web和FTP#footnote[最初的实验设计中还包含实现一个FTP服务器。但由于时间限制最终没有在服务器具体配置上实现但保留了相应的特殊NAT转换规则。]服务器配置了静态的地址转换使得外网用户能够通过预留的公网地址172.163.1.9和172.163.3.9访问内网的Web服务。
通过与其他组员的密切合作,我们不仅顺利完成了任务,还在过程中学到了许多新的知识。大家在讨论和解决问题的过程中,彼此分享经验和观点,使得整个实验过程既高效又充实。
]
=== 二把手的心得感悟
#para[
本次实验收获颇丰。通过让交换机学习老板及老板助理PC的MAC地址限制了其他设备的接入成功完成了MAC端口安全的配置有效的增强了网络的安全性和可控性。DHCP的配置实现了接入层IP地址的动态分配让网络管理更为方便大大减少了手动配置的工作量。在核心交换机与防火墙之间配置的STP成功消除了网络环路保障了网络的稳定性避免了因环路引发的广播风暴等问题。整个实验过程让我将理论知识与实践紧密结合提升了网络工程实践能力还增强了团队间的协作能力和问题解决能力。在面对复杂的网络配置问题时我们能够共同探讨、分析并找到解决方案这将对我们今后的学习和工作产生积极而深远的影响。
]
#show heading: it => box(width: 100%)[
#v(0.50em)
#set text(font: hei)
// #counter(heading).display()
// #h(0.5em)
#it.body
]
#pagebreak()
#bibliography("ref.yml",full: true,title: "参考文献",style:"gb-7714-2015-numeric")
/*
根据这个网站的格式示范https://github.com/typst/hayagriva/blob/main/docs/file-format.md
为这个网页生成.yml文件
https://blog.csdn.net/jxjdhdnd/article/details/138009187
*/