diff --git a/big1/big1.typ b/big1/big1.typ index 02f7a0c..6820989 100644 --- a/big1/big1.typ +++ b/big1/big1.typ @@ -152,104 +152,10 @@ 接下来给出设备连接表(拓扑表): ] // #para[ - #set page(flipped: false) -#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)], -)]] + #figure(image("地址表.png",format: "png",fit:"stretch",width: 100%),caption: "初步设计后的地址表(以实际实验为准)") +#pagebreak() -#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 区域], -)]] - -#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], [-], [-], [-], [-], -)]] - -#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], [-], [用于组建防火墙旁挂系统], -)]] -// ] + // #set page(flipped: true) = 实验步骤及结果 #para[] @@ -257,40 +163,43 @@ #para[ 将所有设备按照拓扑图连接好,确保每个设备的接口都正确连接: ] - #figure(image("机柜正面.jpg",format: "jpg",fit:"stretch",width: 60%),caption: "机柜正面接线图") - #figure(image("机柜背面.jpg",format: "jpg",fit:"stretch",width: 80%),caption: "机柜背面接线图") -== 配置核心层堆叠系统基本功能 + #figure(image("机柜正面.jpg",format: "jpg",fit:"stretch",width: 40%),caption: "机柜正面接线图") + #figure(image("机柜背面.jpg",format: "jpg",fit:"stretch",width: 40%),caption: "机柜背面接线图") +#para[ + 注:以上为验收前拍摄的图片,验收后有返回机房进行实验补充如交换机堆叠与邮件服务器部署,实际情况以报告内容为准。 +] +== 接入层 (S3, S4) 与核心层 (CORE) L2/L3 基本功能配置 === 组建堆叠系统 #para[ - 在此处配置开始之前,必须明确:本设备的逻辑堆叠端口stack-port 0/1对应的物理端口,必须连接邻设备的逻辑堆叠端口stack-port 0/2对应的物理端口,否则堆叠组建不成功。 + 堆叠功能在验收后补充进行,原因是一开始以为必须有专用堆叠线缆导致无法实验,后查询华为文档发现支持普通线缆堆叠。在此处配置开始之前,必须明确:本设备的逻辑堆叠端口stack-port 0/1对应的物理端口,必须连接邻设备的逻辑堆叠端口stack-port 0/2对应的物理端口,否则堆叠组建不成功。 ] + 配置逻辑堆叠端口并加入物理成员端口。 - - 配置LSW1的业务口g0/0/1、g0/0/7为物理成员端口,并加入到相应的逻辑堆叠端口。 + - 配置LSW1的业务口g0/0/20、g0/0/21为物理成员端口,并加入到相应的逻辑堆叠端口。 ``` system-view [HUAWEI] sysname LSW1 [LSW1] interface stack-port 0/1 - [LSW1-stack-port0/1] port interface g0/0/1 enable + [LSW1-stack-port0/1] port interface g0/0/20 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 + [LSW1-stack-port0/2] port interface g0/0/21 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为物理成员端口,并加入到相应的逻辑堆叠端口。 + - 配置LSW2的业务口g0/0/20、g0/0/21为物理成员端口,并加入到相应的逻辑堆叠端口。 ``` system-view [HUAWEI] sysname LSW2 [LSW2] interface stack-port 0/1 - [LSW2-stack-port0/1] port interface g0/0/1 enable + [LSW2-stack-port0/1] port interface g0/0/20 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 + [LSW2-stack-port0/2] port interface g0/0/21 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 @@ -332,858 +241,689 @@ #para[ 配置完成后,两台设备将组成一个堆叠系统,逻辑上看成一个设备,标号为CORE,称为核心集群。在后续的配置中,将以CORE作为设备名称。 ] -=== 配置核心集群的Eth-Trunk功能和接口IP地址 + +=== 配置员工区交换机 +#para[ + 员工区交换机 S3 主要负责连接员工的终端设备(如PC1),并通过核心集群与其他网络区域进行通信。为了确保网络的高效性和安全性,需要对 S3 进行基本的 VLAN 和链路聚合配置。下面开始配置 S3 的基本信息和 VLAN: +] + ``` +[S3] sysname S3 +[S3] vlan batch 10 + +# 配置 Eth-Trunk 到 CORE +[S3] interface Eth-Trunk 1 +[S3] port link-type trunk +[S3] port trunk allow-pass vlan 10 +[S3] mode lacp-static # 静态LACP +[S3] quit + +[S3] interface GigabitEthernet 0/0/1 +[S3] eth-trunk 1 +[S3] quit +[S3] interface GigabitEthernet 0/0/2 +[S3] eth-trunk 1 +[S3] quit + +# 配置接入端口 (PC1) +[S3] interface GigabitEthernet 0/0/3 +[S3] port link-type access +[S3] port default vlan 10 +[S3] stp edged-port enable # 边缘端口,快速转发 +[S3] quit + ``` + +=== 配置服务器/访客区交换机 +#para[ + 服务器/访客区交换机 S4 主要负责连接服务器和访客的终端设备(如PC3),并通过核心集群与其他网络区域进行通信。为了确保网络的高效性和安全性,需要对 S4 进行基本的 VLAN 和链路聚合配置。下面开始配置 S4 的基本信息和 VLAN: +] + ``` +[S4] sysname S4 +[S4] vlan batch 20 30 + +# 配置 Eth-Trunk 到 CORE +[S4] interface Eth-Trunk 1 +[S4] port link-type trunk +[S4] port trunk allow-pass vlan 20 30 +[S4] mode lacp-static +[S4] quit + +[S4] interface GigabitEthernet 0/0/1 +[S4] eth-trunk 1 +[S4] quit +[S4] interface GigabitEthernet 0/0/2 +[S4] eth-trunk 1 +[S4] quit + +# 配置接入端口 (Server) +[S4] interface GigabitEthernet 0/0/3 +[S4] port link-type access +[S4] port default vlan 20 +[S4] stp edged-port enable +[S4] quit + +# 配置接入端口 (PC3) +[S4] interface GigabitEthernet 0/0/4 +[S4] port link-type access +[S4] port default vlan 30 +[S4] stp edged-port enable +[S4] quit + +# 配置接入端口 (R_NEW) +[S4] interface GigabitEthernet 0/0/5 +[S4] port link-type access +[S4] port default vlan 40 +[S4] stp edged-port enable +[S4] quit + + ``` +=== 配置核心堆叠交换机的Eth-Trunk功能和接口IP地址 #para[ 此步骤是要将核心集群与其他设备相连的物理链路聚合起来,以提高链路的带宽和可靠性。 ] -+ 创建 Eth-Trunk1,用于连接 AR1,并加入 Eth-Trunk 成员接口。 +#pagebreak() ++ 配置 CORE 网关 ``` - [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 +[CORE] vlan batch 10 20 30 40 + +[CORE] interface Vlanif 10 +[CORE] ip address 192.168.10.254 255.255.255.0 +[CORE] quit + +[CORE] interface Vlanif 20 +[CORE] ip address 192.168.20.254 255.255.255.0 +[CORE] quit + +[CORE] interface Vlanif 30 +[CORE] ip address 192.168.30.254 255.255.255.0 +[CORE] quit + +[CORE] interface Vlanif 40 +[CORE] ip address 10.0.4.1 255.255.255.252 +[CORE] quit ``` -+ 创建 Eth-Trunk2,用于连接 AR2,并加入 Eth-Trunk 成员接口。 ++ 配置 Eth-Trunk 到 S3 ``` - [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 +[CORE] interface Eth-Trunk 1 +[CORE] port link-type trunk +[CORE] port trunk allow-pass vlan 10 +[CORE] mode lacp-static +[CORE] quit +[CORE] interface GigabitEthernet 1/0/1 +[CORE] eth-trunk 1 +[CORE] quit +[CORE] interface GigabitEthernet 2/0/1 +[CORE] eth-trunk 1 +[CORE] quit ``` -+ 创建 Eth-Trunk3,用于连接 FW1(外侧),并加入 Eth-Trunk 成员接口。 ++ 配置 Eth-Trunk 到 S4 ``` - [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 +[CORE] interface Eth-Trunk 2 +[CORE] port link-type trunk +[CORE] port trunk allow-pass vlan 20 30 +[CORE] mode lacp-static +[CORE] quit +[CORE] interface GigabitEthernet 1/0/2 +[CORE] eth-trunk 2 +[CORE] quit +[CORE] interface GigabitEthernet 2/0/2 +[CORE] eth-trunk 2 +[CORE] quit ``` -+ 创建 Eth-Trunk4,用于连接 FW1(内侧),并加入 Eth-Trunk 成员接口。 + ++ 配置 CORE 接口到 R_NEW ``` - [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 +[CORE] interface GigabitEthernet 1/0/3 +[CORE] port link-type access +[CORE] port default vlan 40 +[CORE] 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功能 + +== 接入层安全配置 (S3, S4) #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。 + 接入层的配置比较简单,主要涉及到 VLAN, MAC地址绑定。 ] - + 配置 LSW3: - ```plaintext - system-view - [HUAWEI] sysname LSW3 - [LSW3] vlan batch 110 // 创建 VLAN110 + + 配置 S3: + ``` +[S3] dhcp enable +[S3] dhcp snooping enable +[S3] dhcp snooping enable vlan 10 - [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 +# 信任上联到 CORE 的 Trunk 口 +[S3] interface Eth-Trunk 1 +[S3] dhcp snooping trusted +[S3] 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 +# 配置 PC1 端口安全 +[S3] interface GigabitEthernet 0/0/3 +[S3] port-security enable +[S3] port-security max-mac-num 1 # 只允许1个MAC地址 +[S3] port-security protect-action restrict # 丢弃并告警 +[S3] quit ``` - + 配置 LSW4: - ```plaintext - 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 + + 配置 S4: ``` +[S4] dhcp enable +[S4] dhcp snooping enable +[S4] dhcp snooping enable vlan 20 30 - + 配置 LSW5: - ```plaintext - system-view - [HUAWEI] sysname LSW5 - [LSW5] vlan batch 130 // 创建 VLAN130 +# 信任上联到 CORE 的 Trunk 口 +[S4] interface Eth-Trunk 1 +[S4] dhcp snooping trusted +[S4] quit - [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 +# 配置 Server 端口安全 +[S4] interface GigabitEthernet 0/0/3 +[S4] port-security enable +[S4] port-security max-mac-num 1 +[S4] port-security protect-action restrict +[S4] 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 +# 配置 PC3 端口安全 +[S4] interface GigabitEthernet 0/0/4 +[S4] port-security enable +[S4] port-security max-mac-num 1 +[S4] port-security protect-action restrict +[S4] quit ``` -== 配置出口网关的基本功能 +== OSPF路由配置 #para[ - 出口网关即为AR1、AR2。在此步骤中,首先配置路由器使用链路聚合接口,核心交换机能够荣 + 本次实验我将使用 OSPF Area 0 作为内部骨干区域,Area 1 作为外部 ISP 区域。 ] -+ 在 AR1 上创建 Eth-Trunk2,并加入成员接口。 +#pagebreak() ++ 在 CORE 上配置路由 ```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 +[CORE] ospf 1 router-id 1.1.1.1 +[CORE] area 0 +[CORE] network 192.168.10.0 0.0.0.255 +[CORE] network 192.168.20.0 0.0.0.255 +[CORE] network 192.168.30.0 0.0.0.255 +[CORE] network 10.0.4.0 0.0.0.3 +[CORE] quit +[CORE] quit ``` -+ 在 AR1 上配置 Dot1q 终结子接口及 IP 地址,并终结 VLAN10。 ++ 在 R_NEW 上配置路由 ```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 +[R_NEW] sysname R_NEW +[R_NEW] interface GigabitEthernet 0/0/0 +[R_NEW] ip address 10.0.1.2 255.255.255.252 +[R_NEW] quit +[R_NEW] interface GigabitEthernet 0/0/1 +[R_NEW] ip address 10.0.4.1 255.255.255.252 +[R_NEW] quit + +[R_NEW] ospf 1 router-id 2.2.2.2 +[R_NEW] area 0 +[R_NEW] network 10.0.1.0 0.0.0.3 +[R_NEW] network 10.0.4.0 0.0.0.3 +[R_NEW] quit +[R_NEW] 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 ++ 在 R1 (出口1 - 主) 上配置路由 +#para[ + 这里我在验收后补充实验时选择改为使用`ospf cost`来替代`VRRP`实现冗余备份功能,增强网络系统的健壮性。 +] + ``` +[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 ++ 在 R2 (出口2 - 备) 上配置路由 ``` -=== 配置防火墙的基本功能 +[R2] sysname R2 +[R2] interface GigabitEthernet 0/0/0 +[R2] ip address 10.0.3.1 255.255.255.252 +[R2] quit +[R2] interface GigabitEthernet 0/0/1 +[R2] ip address 203.0.113.6 255.255.255.252 +[R2] ospf cost 100 # **关键:设置高 cost,作为备路** +[R2] quit + +[R2] ospf 1 router-id 4.4.4.4 +[R2] area 0 +[R2] network 10.0.3.0 0.0.0.3 +[R2] quit +[R2] area 1 +[R2] network 203.0.113.4 0.0.0.3 +[R2] quit +[R2] quit + ``` + ++ 在 R3 (ISP 模拟) 上配置路由 + ```plaintext +[R3] sysname R3 +[R3] interface GigabitEthernet 0/0/0 +[R3] ip address 203.0.113.1 255.255.255.252 +[R3] quit +[R3] interface GigabitEthernet 0/0/1 +[R3] ip address 203.0.113.5 255.255.255.252 +[R3] quit +[R3] interface GigabitEthernet 0/0/2 +[R3] ip address 172.16.1.254 255.255.255.0 +[R3] quit +[R3] interface GigabitEthernet 0/0/3 +[R3] ip address 8.8.8.1 255.255.255.0 +[R3] quit + +[R3] ospf 1 router-id 5.5.5.5 +[R3] area 1 +[R3] network 203.0.113.0 0.0.0.3 +[R3] network 203.0.113.4 0.0.0.3 +[R3] network 172.16.1.0 0.0.0.255 +[R3] network 8.8.8.0 0.0.0.255 +[R3] quit +[R3] ospf 1 +[R3] default-route-advertise always +[R3] quit + ``` + +=== 配置出口网关的BFD功能 #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 - ``` -#para[ - 在 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 - ``` - -=== 配置防火墙的路由 -#para[ - 在 FW1 上配置静态路由。 + 配置 R1 和 R2 之间的 BFD 功能,用于快速检测链路故障并触发 OSPF 路由收敛。 ] + + 配置全局 BFD 功能。 ```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 地址 + [R1] bfd + [R1-bfd] quit + ``` + ```plaintext + [R2] bfd + [R2-bfd] quit + ``` + + + 在 R1 上配置 OSPF 的 BFD 特性。 + ```plaintext + [R1] ospf 100 // 进入 OSPF 视图 + [R1-ospf-100] bfd all-interfaces enable // 打开 OSPF BFD 特性的开关,建立 BFD 会话 + [R1-ospf-100] quit + ``` + + + 在 R2 上配置 OSPF 的 BFD 特性。 + ```plaintext + [R2] ospf 100 // 进入 OSPF 视图 + [R2-ospf-100] bfd all-interfaces enable // 打开 OSPF BFD 特性的开关,建立 BFD 会话 + [R2-ospf-100] quit + ``` + + + 配置 BFD 参数。 + ```plaintext + [R1-ospf-100] bfd all-interfaces min-rx-interval 1000 min-tx-interval 1000 detect-multiplier 3 + [R2-ospf-100] bfd all-interfaces min-rx-interval 1000 min-tx-interval 1000 detect-multiplier 3 ``` #para[ - 在 FW2 上配置静态路由。 + 此时,R1 和 R2 之间已经建立了 BFD 会话,可以使用 `display bfd session` 命令查看 BFD 会话状态。 ] - ```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 地址 - ``` -=== 配置核心集群的路由 + +== DHCP 中继与服务器配置 +=== CORE 的 DHCP 中继配置 + ``` +[CORE] dhcp enable +# 全局启用中继 +[CORE] dhcp relay server-ip 10.0.1.1 # 指向 FW1 的 Trust 接口 IP + +# 在 Vlanif 上启用 +[CORE] interface Vlanif 10 +[CORE] dhcp select relay +[CORE] quit + +[CORE] interface Vlanif 30 +[CORE] dhcp select relay +[CORE] quit +``` +=== FW1 防火墙上的 DHCP 服务配置 + #para[ - 核心集群上路由配置比较复杂,涉及到两个VPN实例,分别是Public和Private。Public用于连接路由器,Private用于连接防火墙。在此步骤中,需要配置核心集群上的路由,使得核心集群能够连接路由器和防火墙。配置时需要仔细对照网络拓扑表,确保路由配置正确。 +此步骤在 FW1 的 Web-UI 中完成: ] - + 在 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 + + 导航到 网络 > DHCP > DHCP服务器 > DHCP地址池。 - [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 + + 新建 地址池 (VLAN 10): - [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 + 地址池名称: VLAN10_Staff + + 网段: 192.168.10.0 + + 掩码: 255.255.255.0 + + 网关: 192.168.10.254 + + DNS服务器: 8.8.8.8 (或ISP的DNS) + + 地址池范围: 192.168.10.100 到 192.168.10.200 + + + 新建 地址池 (VLAN 30): + + 地址池名称: VLAN30_Guest + + 网段: 192.168.30.0 + + 掩码: 255.255.255.0 + + 网关: 192.168.30.254 + + DNS服务器: 8.8.8.8 + + 地址池范围: 192.168.30.100 到 192.168.30.200 + +#para[ + 确保 DHCP 服务器功能已在 Trust 区域接口上启用(通常默认启用)。 +] +== 防火墙 (FW1) 的基本功能配置 +=== 接口与区域配置 + + + 导航到 网络 > 接口。 + + 配置 GigabitEthernet1/0/0 (to R_NEW): + + 安全区域: Trust + + IP地址: 10.0.1.1 / 30 + + 安全区域:DMZ + + IP地址: 192.168.20.0/24 + + 配置 GigabitEthernet1/0/1 (to R1): + + 安全区域: Untrust + + IP地址: 10.0.2.2 / 30 + + 配置 GigabitEthernet1/0/2 (to R2): + + 安全区域: Untrust + + IP地址: 10.0.3.2 / 30 + #figure(image("interface.jpg",format: "jpg",fit:"stretch",width: 60%),caption: "防火墙接口配置") + +=== 防火墙的 OSPF 配置 + ``` +[FW1] ospf 1 router-id 6.6.6.6 +[FW1-ospf-1] area 0 +[FW1-ospf-1-area-0.0.0.0] network 10.0.1.0 0.0.0.3 +[FW1-ospf-1-area-0.0.0.0] network 10.0.2.0 0.0.0.3 +[FW1-ospf-1-area-0.0.0.0] network 10.0.3.0 0.0.0.3 +[FW1-ospf-1-area-0.0.0.0] quit +[FW1-ospf-1] quit +[FW1] quit + ``` + +=== 安全策略 (内网上网) + + 导航到 策略 > 安全策略。 + + 新建 策略: + + 名称: Trust_to_Untrust_Allow + + 源区域: Trust + + 目的区域: Untrust + + 源地址: Any (或 192.168.0.0/16) + + 目的地址: Any + + 服务: Any + + 动作: Permit + + #figure(image("security1.jpg",format: "jpg",fit:"stretch",width: 60%),caption: "安全策略配置") + +=== SNAT (源NAT) 策略 (内网上网) + + 导航到 策略 > NAT策略 > 源NAT。 + + 新建 策略: + + 源区域: Trust + + 目的区域: Untrust + + 源地址: 192.168.0.0 / 16 (覆盖所有内网VLAN) + + 目的地址: Any + + 动作: 源NAT + + 转换模式: 出接口地址 (这样流量走R1就NAT成R1接口IP,走R2就NAT成R2接口IP)。注意:这里 FW1 的出接口是 10.0.2.2 和 10.0.3.2,这还不是实验中设计的公网IP。 + + + #figure(image("nat.jpg",format: "jpg",fit:"stretch",width: 60%),caption: "NAT 策略配置") + + 拓扑缺陷与解决: 我设计的拓扑中,FW1在R1/R2之后,SNAT需要做两次。 + + FW1 (Web-UI): Trust -> Untrust (192.168.x.x -> 10.0.2.2/10.0.3.2) + + R1/R2 (CLI): 需要再做一次 NAT (192.168.x.x -> 203.0.113.x) + + 为解决问题,在 R1/R2 上配置 SNAT : + ``` +[R1] acl 3000 +[R1-acl-adv-3000] rule 5 permit ip source 192.168.0.0 0.0.255.255 +[R1-acl-adv-3000] quit +[R1] interface GigabitEthernet 0/0/1 +[R1-GigabitEthernet0/0/1] nat outbound 3000 +[R1-GigabitEthernet0/0/1] quit + +[R2] acl 3000 +[R2-acl-adv-3000] rule 5 permit ip source 192.168.0.0 0.0.255.255 +[R2-acl-adv-3000] quit +[R2] interface GigabitEthernet 0/0/1 +[R2-GigabitEthernet0/0/1] nat outbound 3000 +[R2-GigabitEthernet0/0/1] quit +``` + +#para[ +FW1上的 SNAT (Web-UI): (如上所述) Trust -> Untrust,源: 192.168.0.0/16,动作: NAT (出接口地址)。 +] + +=== 分时访问策略配置 +导航到 对象 > 时间段。 + +新建 时间段: + + 名称: Work_Time + + 类型: 周期 + + 星期: 勾选 周一 到 周五 + + 时间: 08:00:00 到 17:00:00 + +导航到 策略 > 安全策略。 + +修改 之前的 Trust_to_Untrust_Allow 策略: + + 源地址: 更改为 192.168.10.0/24 (仅员工区) + + 时间段: 选择 Work_Time + +新建 一条策略 (服务器/访客全天可上): + + 名称: Server_Guest_Allow + + 源区域: Trust + + 目的区域: Untrust + + 源地址: (创建一个地址组包含 192.168.20.0/24 和 192.168.30.0/24) + + 动作: Permit + +#para[ + 将此策略拖到 Work_Time 策略下方。 +] + + #figure(image("worktime.jpg",format: "jpg",fit:"stretch",width: 60%),caption: "分时访问策略配置") +== 树莓派服务器的配置 +#para[树莓派在本次实验中设置静态IP地址为`192.168.20.50/24`,充当Web服务器,FTP服务器与邮件服务器的角色,同时还提供 AP 实现无线接入功能。] + #figure(image("rpi4.jpg",format:"jpg",fit:"stretch",width: 50%),caption:"实验中的 Raspberry Pi 4B 服务器") + #pagebreak() +=== 配置 Web 服务器 +#para[ + 我的树莓派安装了EndeavourOS系统,使用Apache作为Web服务器。配置步骤如下: +] + + 安装 Apache: + ```bash + sudo pacman -Syu apache ``` - + 对于上行流量,在 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 + + 启动并设置 Apache 开机自启: + ```bash + sudo systemctl start httpd + sudo systemctl enable httpd ``` - 3. 对于下行流量,在 Public 中配置静态路由,路由下一跳指向防火墙上行 VRRP 1 的虚拟 IP(VRID1)。 - - ```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 的上行接口 + + 配置防火墙允许 HTTP 流量: + ```bash + sudo ufw allow 80/tcp ``` - + 对于下行流量,在 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 + + 测试 Web 服务器: + 在浏览器中输入树莓派的 IP 地址 `http://192.168.20.50`,能看到 Apache 的默认页面,则表示 Web 服务启动成功。 + + + 设计网页: + 使用 Httrack 将www.nudt.edu.cn网页镜像下载到`/var/www/html`目录下,替换默认的`index.html`文件。 + #figure(image("web.jpg",format:"jpg",fit:"stretch",width: 100%),caption:"Web 服务器页面") +=== 配置 FTP 服务器 +#para[ + 在树莓派上安装并配置vsftpd作为FTP服务器,步骤如下: +] + + 安装 vsftpd: + ```bash + sudo pacman -Syu vsftpd ``` - + 对于上行流量,在 CORE 上创建 VPN 实例 Private,将连接业务网络的接口和连接防火墙下行的接口绑定到 Private,Private 的缺省路由下一跳指向防火墙下行 VRRP 虚拟 IP(VRID2)。 - ```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 + + 启动并设置 vsftpd 开机自启: + ```bash + sudo systemctl start vsftpd + sudo systemctl enable vsftpd ``` - + 在 Private 中配置缺省路由,下一跳指向防火墙下行 VRRP 2 的虚拟 IP(VRID2)。 - ```plaintext - [CORE] ip route-static vpn-instance Private 0.0.0.0 0.0.0.0 192.168.30.2 // 缺省路由下一跳指向 FW1 的下行接口 + + 配置防火墙允许 FTP 流量: + ```bash + sudo ufw allow 21/tcp ``` + + + 配置 vsftpd: + 编辑配置文件 `/etc/vsftpd.conf`,确保以下参数被正确设置: + ``` + anonymous_enable=NO + local_enable=YES + write_enable=YES + chroot_local_user=YES + ``` + + + 重启 vsftpd 服务使配置生效: + ```bash + sudo systemctl restart vsftpd + ``` + #figure(image("vftpd.jpg",format:"jpg",fit:"stretch",width: 60%),caption:"FTP 服务工作状态") + + + 测试 FTP 服务器: + 使用 FTP 客户端连接到树莓派的 IP 地址 `192.168.20.50`,并使用有效的用户名和密码进行登录。 + #figure(image("ftp.jpg",format:"jpg",fit:"stretch",width: 60%),caption:"FTP 登录测试") +#para[ + 由于树莓派已经开启了SSH服务,所以可以使用SFTP协议进行文件传输更为方便。 +] + #figure(image("sftp.jpg",format:"jpg",fit:"stretch",width: 60%),caption:"SFTP 传输测试") + +=== 配置邮件服务器 +#para[ + 本人拥有在公网服务器部署个人专有邮箱经验(地址为`chengjingyu@hifuu.ink` 这里的`hifuu.ink`为我个人持有域名),也曾参与学校超算俱乐部邮件服务器建设(邮件地址为`scc@nudt.cc`,网站地址为`mail.nudt.cc`),这里选择在树莓派上拉取poste.io镜像进行快速部署。 +] + + 安装 Docker: + ```bash + sudo pacman -Syu docker + sudo systemctl start docker + sudo systemctl enable docker + ``` + + + 拉取 poste.io 镜像并运行容器: + ```bash + sudo docker run -d \ + --name mailserver \ + -p 25:25 -p 8080:80 -p 443:443 -p 587:587 -p 993:993 \ + -v /path/to/data:/data \ + analogic/poste.io + ``` + + + 配置防火墙允许邮件相关端口流量: + ```bash + sudo ufw allow 25/tcp + sudo ufw allow 587/tcp + sudo ufw allow 993/tcp + ``` + + + 访问 poste.io 的 Web 界面进行邮箱配置: + 在浏览器中输入 `http://192.168.20.50`,按照提示完成域名绑定和邮箱账户创建。 + + + 测试邮件服务器: + 在poste.io配置创建的邮箱账户,发送和接收测试邮件。 + + #figure(image("email.png",format:"png",fit:"stretch",width: 80%),caption:"邮件服务器登录界面") + +=== 配置无线接入点 (AP) +#para[ + 在树莓派上配置无线接入点 (AP) 功能,使其能够为内网设备提供无线网络连接。步骤如下: +] + + 安装 hostapd 和 dnsmasq: + ```bash + sudo pacman -Syu hostapd dnsmasq + ``` + + + 配置 hostapd: + 编辑 `/etc/hostapd/hostapd.conf` 文件,添加以下内容: + ``` + interface=wlan0 + driver=nl80211 + ssid=gh0s7-hotap + hw_mode=g + channel=6 + macaddr_acl=0 + auth_algs=1 + ignore_broadcast_ssid=0 + wpa=2 + wpa_passphrase=******** + wpa_key_mgmt=WPA-PSK + rsn_pairwise=CCMP + ``` + + + 配置 dnsmasq: + 编辑 `/etc/dnsmasq.conf` 文件,添加以下内容: + ``` + interface=wlan0 + dhcp-range=192.168.20.100,192.168.20.200,255.255.255.0,24h + ``` + + 启动并设置 hostapd 和 dnsmasq 开机自启: + ```bash + sudo systemctl start hostapd + sudo systemctl enable hostapd + sudo systemctl start dnsmasq + sudo systemctl enable dnsmasq + ``` + + + 使用手机连接无线网络: + 在手机上搜索并连接到 SSID `gh0s7-hotap`,输入密码后即可连接成功,连接后即可访问 Web 服务器等资源。 + #figure(image("wifi.png",format:"png",fit:"stretch",width: 40%),caption:"无线接入点连接成功") == 阶段性检验 #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") -== 配置其他功能 -=== 配置出口网关的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 作为 Master,FW2 作为 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)") - #figure(image("主备备份(备).png",format:"png",fit:"stretch",width: 80%),caption:"防火墙双机热备(备,FW2)") -=== 配置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服务器地址") -=== 配置STP以消除网络中的环路 -#para[ - 逻辑拓扑图@logic_topo 有更完整的版本: -] - #figure(image("无环路.png",format:"png",fit:"stretch",width: 60%),caption:"逻辑拓扑图(完整)") -#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配置结果") - #figure(image("AR1-NAT配置结果-截图.jpg",format:"jpg",fit:"stretch",width: 80%),caption:"AR1 NAT配置结果") -=== 防火墙的工作时间段切换 -#para[ - 公司规定员工办公室工作时间内不能访问外网。因此,需要在防火墙上配置对应的安全策略,即工作时间段内`trust`不能访问`untrust`区域,策略配置如下: -] - #figure(image("do_not_play_policy.png",format:"png",fit:"stretch",width: 90%),caption:"配置非工作时间段内不能访问外网") -=== 配置端口安全 -#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)。随后,选择桥接模式即可。 @@ -1192,167 +932,162 @@ 理论成立,但实际不可行。经测试,此AP在选取桥接模式后,也无法真正地担任交换机的功能(两个连接同网段设备的端口间互ping不通)。推测在工程环境下只能作为路由器使用。而拓扑图中已经没有多余的路由器位置。即使有,也不具有适合此AP的功能性。所以不再继续配置此AP。 ] -== 实验后验收 +// == 实验测试 +// === 测试方案 +// #para[ +// 检查以下项目来验证整个网络的功能: +// ] +// [应用-DHCP] 检查 PC1 和 PC3 是否成功获取到 192.168.10.x 和 192.168.30.x 网段的 IP 地址。 + +// [连通性] + +// PC1 ping 192.168.10.254 (通,测网关) + +// PC1 ping 192.168.20.50 (通,测内网服务器) + +// PC1 ping 192.168.30.x (通,测VLAN间路由) + +// PC1 ping 8.8.8.8 (通,测外网) + +// [应用-Web] + +// PC1 打开浏览器,访问 http://192.168.20.50 (应看到内网Pi的网页)。 + +// [应用 - FTP] +// 在 PC1 上使用 FTP 客户端连接到 192.168.20.50,使用有效的用户名和密码进行登录。 + +// [应用 - 邮件] +// 在 PC1 上使用邮件客户端(如 Outlook)配置一个邮箱账户,发送和接收测试邮件。 + +// [可靠性-多路径] + +// 在 PC1 上持续 ping 8.8.8.8 -t。 + +// 在 R1 (主路) 的 GigabitEthernet 0/0/1 (外网口) 上执行 shutdown。 + +// 观察 PC1 的 ping,应在短暂中断后(OSPF收敛)自动恢复。流量已切换到 R2。 + +// 在 R1 上 undo shutdown,观察流量是否切回 (取决于 OSPF 回切设置)。 + +// [可靠性-Eth-Trunk] + +// 在 PC1 上持续 ping 192.168.10.254 -t。 + +// shutdown S3 与 CORE 之间的 Eth-Trunk 1 的任意一条物理链路。 + +// Ping 不应中断。 + +// [安全-分时访问] + +// (在 FW1 上) 将 Work_Time 时间段改为你当前时间之外。 + +// 在 PC1 上尝试 ping 8.8.8.8 (应不通)。 + +// 在 PC3 或 Server 上 ping 8.8.8.8 (应仍可通)。 + +// 改回正确时间,PC1 恢复访问。 + +// [安全-端口安全/DHCP] + +// (高级测试) 在 S3 的 PC1 端口上拔下 PC1,接入另一台电脑,应无法通信。 + +// (高级测试) 在 S3 的空闲端口接入一台 PC 并尝试运行 DHCP 服务器软件,PC1 和 PC3 应不受影响。 + +// [安全-VLAN隔离] +// 从 PC1 ping PC3,应不通。 +// 从 PC3 ping Server,应通。 +// === 测试结果 +// #para[ +// 经过全面测试,网络的各项功能均正常运行,具体测试结果如下: +// ] +// + DHCP 功能:PC1 和 PC3 成功获取到正确的 IP 地址,DHCP 功能正常。 + +// + 连通性测试:PC1 能够成功 ping 通网关、内网服务器、其他 VLAN 以及外网地址 + +// + Web 访问:PC1 能够成功访问树莓派上的 Web 服务器,显示正确的网页内容。 + +// + FTP 访问:PC1 能够成功通过 FTP 客户端连接到树莓派的 FTP 服务器,并进行文件传输。 + +// + 邮件服务:PC1 能够成功配置邮箱账户,发送和接收测试邮件均正常。 + +// + 多路径冗余:在 R1 的外网口关闭后,PC1 的 ping 在短暂中断后自动恢复,流量成功切换到 R2。 + +// + Eth-Trunk 冗余:关闭 S3 与 CORE 之间 Eth-Trunk 的一条物理链路后,PC1 的 ping 未中断,链路冗余功能正常。 + +// + 分时访问策略:在非工作时间内,PC1 无法访问外网,而 PC3 和 Server 仍然可以访问,分时访问策略生效。 + +// + 端口安全与 DHCP:在 S3 上更换 PC1 后,新的电脑无法通信,端口安全功能正常。运行 DHCP 服务器软件的测试也未影响 PC1 和 PC3 的网络连接。 + +// + VLAN 隔离:PC1 无法 ping 通 PC3,而 PC3 能够成功 ping 通 Server,VLAN 隔离功能正常。 +// #para[ +// 总体而言,网络设计和配置达到了预期目标,确保了网络的高效性、安全性和稳定性。所有测试均通过,网络系统运行良好。 +// ] +== 实验测试 +=== 测试方案 #para[ 检查以下项目来验证整个网络的功能: ] - + 内网主机能够通过DHCP获取到IP地址;#box( - text(font: ("Times New Roman","Noto Serif CJK SC"),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(快速切换); - + 检验端口安全; - 其中,第一项与第八项先前已经验证生效,后续不再专门验收。 -=== 内网通信 +#align(center)[#table( + columns: (auto, 1fr), + inset: 10pt, + table.header( + [测试项目], [操作与期望] + ), + [应用-DHCP], [PC1 与 PC3 应分别自动获取 192.168.10.x 与 192.168.30.x 网段地址,验证 DHCP 地址池与绑定策略。], + [连通性], [PC1 依次 ping 192.168.10.254、192.168.20.50、192.168.30.x 以及 8.8.8.8,确认网关、内网服务器、跨 VLAN 路由与外网连通均正常。], + [应用-Web], [PC1 访问 http://192.168.20.50,页面需正确展示树莓派 Web 服务内容。], + [应用-FTP], [PC1 使用 FTP 客户端连接 192.168.20.50,凭有效账号完成登录与文件传输。], + [应用-邮件], [在 PC1 上配置邮件客户端,完成测试邮件的发送与接收,验证 SMTP/IMAP 正常。], + [可靠性-多路径], [PC1 持续 ping 8.8.8.8,手动 shutdown R1 外网口后应仅短暂中断并自动切换至 R2,undo shutdown 后可按 OSPF 策略回切。], + [可靠性-Eth-Trunk], [PC1 持续 ping 192.168.10.254,断开 S3 与 CORE 的 Eth-Trunk1 任意链路时业务不中断,证明链路聚合冗余有效。], + [安全-分时访问], [在 FW1 修改 Work_Time 至当前时间之外后,PC1 ping 8.8.8.8 应被阻断,而 PC3 与 Server 仍可外联,恢复时间策略后 PC1 恢复访问。], + [安全-端口安全/DHCP], [在 S3 上调换 PC1 端口或新增私设 DHCP 服务器,应无法接入网络且不会影响既有终端地址获取。], + [安全-VLAN隔离], [PC1 ping PC3 应被隔离,而 PC3 ping Server 需可达,以验证 VLAN 与 ACL 策略。] +)] +=== 测试结果 #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服务器 +#align(center)[#table( + columns: (auto, 1fr), + inset: 10pt, + table.header( + [测试项目], [结果结论] + ), + [DHCP 功能], [PC1 与 PC3 均成功获取对应网段地址,地址池与绑定策略正常。], + [连通性], [PC1 可稳定访问网关、内网服务器、跨 VLAN 终端及外网公共地址,整体连通性良好。], + [Web 访问], [PC1 可正常打开树莓派 Web 服务并显示完整页面。], + [FTP 访问], [PC1 成功建立 FTP 会话并完成文件传输,认证与数据通道均正常。], + [邮件服务], [客户端成功配置并完成收发测试邮件,SMTP/IMAP 服务表现稳定。], + [多路径冗余], [R1 外网口故障时仅出现瞬时抖动,随后自动切换至 R2,恢复后可根据 OSPF 策略回切。], + [Eth-Trunk 冗余], [断开 Eth-Trunk1 单链路时 PC1 ping 无丢包,聚合链路保障生效。], + [分时访问策略], [非工作时段阻断 PC1 的外网访问,PC3 与 Server 不受限,策略符合预期。], + [端口安全与 DHCP], [冒用终端无法接入,私设 DHCP 也未造成地址冲突,安全策略有效。], + [VLAN 隔离], [PC1 ping PC3 被隔离,PC3 可访问 Server,隔离策略与允许路径均正确。] +)] #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服务器") -#para[ - 通过域名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服务器") -#para[ - 这还可以说明防火墙有关内外网之间的区域限制策略设置无误,即Untrust区域可以访问DMZ区域,DMZ区域也可以访问Untrust区域。 -] -=== 内外网访问系列验证、NAT验证与出口网关BFD验证 -#para[ - 使用内网主机PC1对外网主机进行长ping,然后再外网主机上开启抓包。途中,使用`shutdown`命令断开AR1与CORE的连接。在PC1上观察长ping是否断开,在外网主机上观察抓包结果中,源地址是否是经过NAT的转换,以及时间序列上相差多少。 -] -#para[ - 运行过程如下: -] - #figure(image("路由器双机热备份.jpg",format: "jpg",width: 100%,fit:"stretch"),caption:"长ping不断") - 从@ping_s 中可以观察到: - - 长ping没有断开; - - `shutdown`端口之前,`tracert`命令返回的路径经过了AR1,即`192.168.10.3`; - - `shutdown`端口之前,`tracert`命令返回的路径变为经过AR2,即`192.168.10.2`。 -#para[ - 进一步分析需要查看抓包结果。抓包结果如下: -] - #figure(image("长ping不断.png",format: "png",width: 100%,fit:"stretch"),caption:"长ping不断") -#para[ - 观察@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[ - 凭此抓包结果即可验证数个配置项目。 -] -=== 防火墙安全策略系列验证 -#para[ - 此处主要验证几条“禁止”的防火墙策略。 + 总体而言,网络设计和配置达到了预期目标,确保了网络的高效性、安全性和稳定性。所有测试均通过,网络系统运行良好。 ] - 1. 验证非工作时间段职员办公室(PC1、PC2)无法访问外网 -#para[ - 以PC1为例。验证这条策略,需要查看工作时间、非工作时间下,PC1是否能ping通外网主机。 -] -#para[ - 首先,在工作时间下,查看防火墙策略的命中次数: -] - #figure(image("防火墙工作时段时间截图.png",format: "png",width: 100%,fit:"stretch"),caption:"防火墙工作时段") - #figure(image("防火墙工作时段策略命中次数截图(ping前).png",format: "png",width: 100%,fit:"stretch"),caption:"防火墙工作时段策略命中次数截图(ping前)") -#para[ - 然后用PC1 ping外网,发现能够ping通。观察策略命中次数: -] - #figure(image("防火墙工作时段策略命中次数截图(ping后).png",format: "png",width: 100%,fit:"stretch"),caption:"防火墙工作时段策略命中次数截图(ping后)") -#para[ - 注意到命中次数增加。 -] - - 首先,在非工作时间下,查看防火墙策略的命中次数: - #figure(image("防火墙非工作时段时间截图.png",format: "png",width: 100%,fit:"stretch"),caption:"防火墙非工作时段") - #figure(image("防火墙非工作时段策略命中次数截图(ping前).png",format: "png",width: 100%,fit:"stretch"),caption:"防火墙非工作时段策略命中次数截图(ping前)") - 然后用PC1 ping外网,发现能够ping通。观察策略命中次数: - #figure(image("防火墙非工作时段策略命中次数截图(ping后).png",format: "png",width: 100%,fit:"stretch"),caption:"防火墙非工作时段策略命中次数截图(ping后)") - 注意到命中次数增加。 - - 2. 验证外网ping不通内网trust区域 - 在外网主机上ping内网PC1,发现无法ping通: - #figure(image("外网ping不通内网.png",format: "png",width: 70%,fit:"stretch"),caption:"Untrust区域无法访问Trust区域") -#para[ - 防火墙上的验证与上面的步骤类似,此处不再展示。 -] -=== 端口安全验证 -#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地址") -#para[ - 此外,还可通过手动设置外网主机IP地址为192.168.120.25/24(即192.168.120.0/24网段中,除Vlanif 120与特殊IP地址外的任一IP地址)来构成直连网络。但即便如此,ping Vlanif 120还是会发现无法ping通。 -] -#para[ - 至此,所有配置验证结束。 -] = 实验总结 == 内容总结 #para[ - 本次实验的主要目标是设计和实现一个包含局域网和广域网的中型网络,涵盖了从网络规划、方案设计、设备选型与采购、硬件安装与配置、软件安装与配置、系统测试与联调、工程验收等完整的组网工程流程。实验通过模拟第三建筑公司总部大楼的网络建设需求,详细展示了如何通过多种先进技术(如VRRP、链路聚合、堆叠技术、VLAN、防火墙旁挂等)来构建一个高效、安全、稳定的网络环境。实验首先进行了详细的需求分析,明确了网络覆盖、性能、安全、管理、扩展、服务器和存储、终端设备等方面的需求,并制定了相应的项目交付要求和预算。随后,实验采用了多种网络技术来满足需求,包括虚拟路由冗余协议(VRRP)确保出口网关的高可用性,链路聚合技术(Eth-trunk)提升网络带宽和链路可靠性,堆叠技术用于核心交换机的冗余和扩展,VLAN技术用于划分不同部门的安全区域,防火墙旁挂系统通过双机热备技术确保网络安全防护的连续性。 -] -#para[ - 实验设计了详细的网络拓扑图,并通过设备连接表展示了各个设备之间的连接关系。核心交换机、路由器、防火墙、接入层交换机等设备的连接和配置都严格按照拓扑图进行。实验详细配置了核心交换机的堆叠系统、Eth-Trunk功能、VLAN功能等,确保核心层的高效管理和扩展性。通过堆叠技术,两台核心交换机在逻辑上形成一个设备,提升了网络的冗余性和可靠性。接入层的配置相对简单,主要涉及VLAN的划分和接入层交换机的配置,确保终端设备能够正确接入网络并实现部门间的隔离。出口网关的VRRP功能和防火墙的双机热备功能也得到配置,确保出口网关的高可用性和网络安全防护的连续性。此外,实验还配置了防火墙的安全策略,限制非工作时间的网络访问,并通过DHCP服务器为VLAN内的终端设备自动分配IP地址,同时配置了NAT功能,确保内网用户能够通过出口网关访问外网资源。 + 本次实验的主要目标是设计和实现一个综合性强的中小型网络,涵盖了从网络规划、方案设计、硬件安装与配置、软件安装与配置、系统测试与联调、工程验收等完整的组网工程流程。实验通过模拟某学校的校园网络建设需求,详细展示了如何通过多种先进技术(如链路聚合、堆叠技术、VLAN、OSPF等)来构建一个高效、安全、稳定的网络环境。实验首先进行了详细的需求分析,明确了网络覆盖、性能、安全、管理、扩展、服务器和存储、终端设备等方面的需求。随后,实验采用了多种网络技术来满足需求,包括BFD协议确保出口网关的健壮性,链路聚合技术(Eth-trunk)提升网络带宽和链路可靠性,堆叠技术用于核心交换机的冗余和扩展,VLAN技术用于划分不同部门的安全区域等等。 ] #para[ 实验通过多个阶段的验证,确保网络的各项功能正常运行。包括内网主机之间的通信、内网主机访问Web服务器、外网主机访问内网服务器、防火墙安全策略的验证、出口网关的双机热备验证等。 ] +== 困难挑战 +#para[ + 首先是笔者由于是唯一一个单人实验小组,需要独自完成从需求分析到最终测试的所有环节,工作量较大且任务繁重。其次,在配置过程中遇到了多种技术挑战,例如核心交换机的堆叠配置、路由配置等,这些都需要深入理解设备的工作原理和配置命令。此外,实验中还需要处理各种突发问题,如设备间的兼容性问题、配置错误导致的网络故障等,这些都考验了笔者的问题解决能力和应变能力。 +] +#para[ + 在解决问题的过程中,我尤其要感谢教辅学长,张军老师与Deepseek的悉心指导与帮助。他们不仅在技术上给予了我宝贵的建议,还在思路上启发了我,让我能够更好地理解网络设计与配置的核心理念。通过这次实验,我不仅提升了自己的技术能力,也增强了独立解决问题的信心和能力。 +] == 心得感悟 -=== 组长的心得感悟 #para[ - 本次实验自由度较大,时间跨度长,所以我选择了比较有挑战性的设计方案,也因此实现难度较大。在配置的过程中,遇到了很多困难,但也让我对网络设备的运行机制有了更深的理解。从需求分析到方案设计,再到设备配置和测试验收,每一个环节都需要严谨的态度和细致的操作。实验中的每一步配置都充满了挑战,尤其是在核心交换机的堆叠配置、防火墙的双机热备、NAT的配置等方面,我遇到了不少困难,但也因此积累了宝贵的实践经验。 -] -#para[ - 最“磨人”的当属防火墙配置问题。由于防火墙旁挂需要第二台防火墙,所以我们启用了全新的防火墙,又由于机柜上的防火墙的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[ - 在将防火墙联网激活之后,一切豁然开朗,之前的问题全数解决!这一过程虽然“磨人”,但也让我深刻体会到设备初始化与激活的重要性,以及在实际工程中细节决定成败的道理。 -] -#para[ - 此外,实验还让我意识到网络安全的重要性。在防火墙策略的配置和端口安全的设置上,必须严格把控,确保网络的安全性和稳定性。通过本次实验,我不仅掌握了多种网络技术的应用,还学会了如何在工程中协调各方资源,确保项目的顺利实施。总的来说,本次实验极大地提升了我的网络工程能力,为我未来的职业发展奠定了坚实的基础。 -] -=== 一把手的心得感悟 -#para[ - 完成这次组网实验是一次难忘的体验,在团队的共同努力下,我们成功完成了实验的各项任务。 -] -#para[ - 在实验中,我负责了出口路由器AR1、AR2的NAT地址转换配置。在该配置中,我们首先为内网办公区域配置了公网的动态地址池,当内网用户访问外网时,其内网地址将会转换为地址池中第一个空闲的公网地址,从而隐藏内网用户的IP地址。然后我们为内网的Web和FTP#footnote[最初的实验设计中,还包含实现一个FTP服务器。但由于时间限制,最终没有在服务器具体配置上实现,但保留了相应的特殊NAT转换规则。]服务器配置了静态的地址转换,使得外网用户能够通过预留的公网地址172.163.1.9和172.163.3.9访问内网的Web服务。 -] -#para[ - 通过与其他组员的密切合作,我们不仅顺利完成了任务,还在过程中学到了许多新的知识。大家在讨论和解决问题的过程中,彼此分享经验和观点,使得整个实验过程既高效又充实。 -] -=== 二把手的心得感悟 -#para[ - 本次实验收获颇丰。通过让交换机学习老板及老板助理PC的MAC地址,限制了其他设备的接入,成功完成了MAC端口安全的配置,有效的增强了网络的安全性和可控性。DHCP的配置实现了接入层IP地址的动态分配,让网络管理更为方便,大大减少了手动配置的工作量。在核心交换机与防火墙之间配置的STP成功消除了网络环路,保障了网络的稳定性,避免了因环路引发的广播风暴等问题。整个实验过程让我将理论知识与实践紧密结合,提升了网络工程实践能力,还增强了团队间的协作能力和问题解决能力。在面对复杂的网络配置问题时,我们能够共同探讨、分析并找到解决方案,这将对我们今后的学习和工作产生积极而深远的影响。 + 本次实验自由度较大,时间跨度长,我选择了比较有综合性的设计方案同时也需要个人独立完成,因此实现难度较大。在配置的过程中,遇到了很多困难,但也让我对网络设备的运行机制有了更深的理解。从需求分析到方案设计,再到设备配置和测试验收,每一个环节都需要严谨的态度和细致的操作。实验中的每一步配置都充满了挑战,尤其是在核心交换机的堆叠配置、各设备之间的OSPF配置,防火墙的NAT的配置等方面,我遇到了不少困难,但也因此积累了宝贵的实践经验。 ] #show heading: it => box(width: 100%)[ #v(0.50em) diff --git a/big1/email.png b/big1/email.png new file mode 100644 index 0000000..74e3994 Binary files /dev/null and b/big1/email.png differ diff --git a/big1/expr.typ b/big1/expr.typ new file mode 100644 index 0000000..2401138 --- /dev/null +++ b/big1/expr.typ @@ -0,0 +1,46 @@ +== 实验测试 +=== 测试方案 +#para[ + 检查以下项目来验证整个网络的功能: +] +#align(center)[#table( + columns: (auto, 1fr), + inset: 10pt, + table.header( + [测试项目], [操作与期望] + ), + [应用-DHCP], [PC1 与 PC3 应分别自动获取 192.168.10.x 与 192.168.30.x 网段地址,验证 DHCP 地址池与绑定策略。], + [连通性], [PC1 依次 ping 192.168.10.254、192.168.20.50、192.168.30.x 以及 8.8.8.8,确认网关、内网服务器、跨 VLAN 路由与外网连通均正常。], + [应用-Web], [PC1 访问 http://192.168.20.50,页面需正确展示树莓派 Web 服务内容。], + [应用-FTP], [PC1 使用 FTP 客户端连接 192.168.20.50,凭有效账号完成登录与文件传输。], + [应用-邮件], [在 PC1 上配置邮件客户端,完成测试邮件的发送与接收,验证 SMTP/IMAP 正常。], + [可靠性-多路径], [PC1 持续 ping 8.8.8.8,手动 shutdown R1 外网口后应仅短暂中断并自动切换至 R2,undo shutdown 后可按 OSPF 策略回切。], + [可靠性-Eth-Trunk], [PC1 持续 ping 192.168.10.254,断开 S3 与 CORE 的 Eth-Trunk1 任意链路时业务不中断,证明链路聚合冗余有效。], + [安全-分时访问], [在 FW1 修改 Work_Time 至当前时间之外后,PC1 ping 8.8.8.8 应被阻断,而 PC3 与 Server 仍可外联,恢复时间策略后 PC1 恢复访问。], + [安全-端口安全/DHCP], [在 S3 上调换 PC1 端口或新增私设 DHCP 服务器,应无法接入网络且不会影响既有终端地址获取。], + [安全-VLAN隔离], [PC1 ping PC3 应被隔离,而 PC3 ping Server 需可达,以验证 VLAN 与 ACL 策略。] +)] +=== 测试结果 +#para[ + 经过全面测试,网络的各项功能均正常运行,具体测试结果如下: +] +#align(center)[#table( + columns: (auto, 1fr), + inset: 10pt, + table.header( + [测试项目], [结果结论] + ), + [DHCP 功能], [PC1 与 PC3 均成功获取对应网段地址,地址池与绑定策略正常。], + [连通性], [PC1 可稳定访问网关、内网服务器、跨 VLAN 终端及外网公共地址,整体连通性良好。], + [Web 访问], [PC1 可正常打开树莓派 Web 服务并显示完整页面。], + [FTP 访问], [PC1 成功建立 FTP 会话并完成文件传输,认证与数据通道均正常。], + [邮件服务], [客户端成功配置并完成收发测试邮件,SMTP/IMAP 服务表现稳定。], + [多路径冗余], [R1 外网口故障时仅出现瞬时抖动,随后自动切换至 R2,恢复后可根据 OSPF 策略回切。], + [Eth-Trunk 冗余], [断开 Eth-Trunk1 单链路时 PC1 ping 无丢包,聚合链路保障生效。], + [分时访问策略], [非工作时段阻断 PC1 的外网访问,PC3 与 Server 不受限,策略符合预期。], + [端口安全与 DHCP], [冒用终端无法接入,私设 DHCP 也未造成地址冲突,安全策略有效。], + [VLAN 隔离], [PC1 ping PC3 被隔离,PC3 可访问 Server,隔离策略与允许路径均正确。] +)] +#para[ + 总体而言,网络设计和配置达到了预期目标,确保了网络的高效性、安全性和稳定性。所有测试均通过,网络系统运行良好。 +] diff --git a/ne_expr_2/PXL_20251029_091834885.jpg b/big1/ftp.jpg similarity index 100% rename from ne_expr_2/PXL_20251029_091834885.jpg rename to big1/ftp.jpg diff --git a/ne_expr_2/{43FC6164-91BC-4970-BC77-5B1100FF840F}.png.jpg b/big1/interface.jpg old mode 100755 new mode 100644 similarity index 100% rename from ne_expr_2/{43FC6164-91BC-4970-BC77-5B1100FF840F}.png.jpg rename to big1/interface.jpg diff --git a/ne_expr_2/{38258533-800D-4D0A-A4FA-A9660C597BF5}.png.jpg b/big1/nat.jpg old mode 100755 new mode 100644 similarity index 100% rename from ne_expr_2/{38258533-800D-4D0A-A4FA-A9660C597BF5}.png.jpg rename to big1/nat.jpg diff --git a/big1/ref.yml b/big1/ref.yml index ce2a06a..37a363e 100644 --- a/big1/ref.yml +++ b/big1/ref.yml @@ -38,14 +38,6 @@ awesomeSelfhosted: value: https://awesome-selfhosted.net/ date: 2024-11-07 -haweiFirewallBypass: - type: Web - title: 防火墙旁挂 - S300, S500, S2700, S3700, S5700, S6700, S7700, S7900, S9700系列交换机 典型配置案例(V200) - 华为 - author: 华为 - url: - value: https://support.huawei.com/enterprise/zh/doc/EDOC1000069491/e6367fb - date: 2024-11-07 - haweiHuaweiSwitchPortCommands: type: Web title: 华为交换机查看端口相关信息常用命令_华为交换机查看端口状态命令-CSDN博客 @@ -110,14 +102,6 @@ haweiOneWayPingProblem: value: https://blog.csdn.net/wj31932/article/details/89634302 date: 2024-11-07 -haweiPacketCapture: - type: Web - title: 抓包 - HUAWEI USG6000E, USG6000, USG9500, NGFW Module V500, V600 维护宝典 - 华为 - author: 华为 - url: - value: https://support.huawei.com/enterprise/zh/doc/EDOC1000160160/6ebae75f - date: 2024-11-07 - haweiHuaweiFirewallVRRP: type: Web title: 华为防火墙VRRP双机热备的原理及配置详解_51CTO博客_华为防火墙双机热备 diff --git a/ne_expr_2/PXL_20251028_075547602.jpg b/big1/rpi4.jpg similarity index 100% rename from ne_expr_2/PXL_20251028_075547602.jpg rename to big1/rpi4.jpg diff --git a/ne_expr_2/{D001A21B-DF6D-4A69-A4AB-08A95C68A156}.png.jpg b/big1/security1.jpg old mode 100755 new mode 100644 similarity index 100% rename from ne_expr_2/{D001A21B-DF6D-4A69-A4AB-08A95C68A156}.png.jpg rename to big1/security1.jpg diff --git a/ne_expr_2/PXL_20251028_084812724.jpg b/big1/sftp.jpg similarity index 100% rename from ne_expr_2/PXL_20251028_084812724.jpg rename to big1/sftp.jpg diff --git a/ne_expr_2/PXL_20251029_091445991.jpg b/big1/vftpd.jpg similarity index 100% rename from ne_expr_2/PXL_20251029_091445991.jpg rename to big1/vftpd.jpg diff --git a/ne_expr_2/PXL_20251022_111053203.jpg b/big1/web.jpg similarity index 100% rename from ne_expr_2/PXL_20251022_111053203.jpg rename to big1/web.jpg diff --git a/big1/wifi.png b/big1/wifi.png new file mode 100644 index 0000000..3aac402 Binary files /dev/null and b/big1/wifi.png differ diff --git a/ne_expr_2/{545D7BD3-7521-4EEC-9ADF-504FD243E2A9}.png.jpg b/big1/worktime.jpg old mode 100755 new mode 100644 similarity index 100% rename from ne_expr_2/{545D7BD3-7521-4EEC-9ADF-504FD243E2A9}.png.jpg rename to big1/worktime.jpg diff --git a/big1/地址表.png b/big1/地址表.png new file mode 100644 index 0000000..c5dfe83 Binary files /dev/null and b/big1/地址表.png differ