1 网络冗余方案实施
1.1 需求
1)如图连接设备,规划好 VLAN 信息
2)在交换网络中,存在大量冗余链路,需要确保没有环路,并提高设备利用率
3)对于每个 VLAN 而言,为提高网关稳定性,部署网关冗余技术
4)确保每个 VLAN 的数据转发路径是最优的
1.2 方案
搭建实验环境,如图 - 1 所示。

图 - 1
1.3 步骤
实现此案例需要按照如下步骤进行。
1)配置交换机的 MSTP 协议(每个交换机都相同)
1. \[SWx\]stp mode mstp2. \[SWx\]stp region-configuration3. \[SWx-mst-region\]region-name HCIE4. \[SWx-mst-region\] instance 1 vlan 105. \[SWx-mst-region\] instance 2 vlan 206. \[SWx-mst-region\] instance 3 vlan 307. \[SWx-mst-region\] instance 4 vlan 408. \[SWx-mst-region\] active region-configuration9. \[SWx-mst-region\] quit
2)SW7 配置为 vlan10/20 的根交换机,vlan30/40 的备份根交换机
1. \[SW7\]stp instance 1 priority 02. \[SW7\]stp instance 2 priority 03. \[SW7\]stp instance 3 priority 40964. \[SW7\]stp instance 4 priority 4096
3)SW8 配置为 vlan30/40 的根交换机,vlan10/20 的备份根交换机
1. \[SW8\]stp instance 3 priority 02. \[SW8\]stp instance 4 priority 03. \[SW8\]stp instance 1 priority 40964. \[SW8\]stp instance 2 priority 4096
4)配置 SW5 为 vlan10/20 的主网关,vlan30/40 的备份网关
1. \[SW5\]interface vlanif 102. \[SW5-Vlanif10\]ip address 192.168.10.251 243. \[SW5-Vlanif10\]vrrp vrid 10 virtual-ip 192.168.10.2544. \[SW5-Vlanif10\]vrrp vrid 10 priority 2006. \[SW5\]interface vlanif 207. \[SW5-Vlanif20\]ip address 192.168.20.251 248. \[SW5-Vlanif20\]vrrp vrid 20 virtual-ip 192.168.20.2549. \[SW5-Vlanif20\]vrrp vrid 20 priority 20011. \[SW5\]interface vlanif 3012. \[SW5-Vlanif30\]ip address 192.168.30.251 2413. \[SW5-Vlanif30\]vrrp vrid 30 virtual-ip 192.168.30.25415. \[SW5\]interface vlanif 4016. \[SW5-Vlanif40\]ip address 192.168.40.251 2417. \[SW5-Vlanif40\]vrrp vrid 40 virtual-ip 192.168.40.254
5)配置 SW6 为 vlan30/40 的主网关,vlan10/20 的备份网关
1. \[SW6\]interface vlanif 102. \[SW6-Vlanif10\]ip address 192.168.10.252 243. \[SW6-Vlanif10\]vrrp vrid 10 virtual-ip 192.168.10.2545. \[SW6\]interface vlanif 206. \[SW6-Vlanif20\]ip address 192.168.20.252 247. \[SW6-Vlanif20\]vrrp vrid 20 virtual-ip 192.168.20.2549. \[SW6\]interface vlanif 3010. \[SW6-Vlanif30\]ip address 192.168.30.252 2411. \[SW6-Vlanif30\]vrrp vrid 30 virtual-ip 192.168.30.25412. \[SW6-Vlanif30\]vrrp vrid 30 priority 20014. \[SW6\]interface vlanif 4015. \[SW6-Vlanif40\]ip address 192.168.40.252 2416. \[SW6-Vlanif40\]vrrp vrid 40 virtual-ip 192.168.40.25417. \[SW6-Vlanif40\]vrrp vrid 40 priority 200
6)确保 VRRP 主网关也成为 DHCP 中继,确保 DHCP 工作正常
1. \[SW5\]dhcp enable2. \[SW5\]interface vlanif 663. \[SW5-Vlanif66\]ip address 192.168.66.253 244. \[SW5-Vlanif66\]quit5. \[SW5\]interface vlanif 106. \[SW5-Vlanif10\]dhcp select relay7. \[SW5-Vlanif10\]dhcp relay server-ip 192.168.66.18. \[SW5\]interface vlanif 209. \[SW5-Vlanif20\]dhcp select relay10. \[SW5-Vlanif20\]dhcp relay server-ip 192.168.66.111. \[SW5\]interface vlanif 3012. \[SW5-Vlanif30\]dhcp select relay13. \[SW5-Vlanif30\]dhcp relay server-ip 192.168.66.114. \[SW5\]interface vlanif 4015. \[SW5-Vlanif40\]dhcp select relay16. \[SW5-Vlanif40\]dhcp relay server-ip 192.168.66.119. \[SW6\]interface vlanif 1020. \[SW6-Vlanif10\]dhcp select relay21. \[SW6-Vlanif10\]dhcp relay server-ip 192.168.66.122. \[SW6\]interface vlanif 2023. \[SW6-Vlanif20\]dhcp select relay24. \[SW6-Vlanif20\]dhcp relay server-ip 192.168.66.125. \[SW6\]interface vlanif 3026. \[SW6-Vlanif30\]dhcp select relay27. \[SW6-Vlanif30\]dhcp relay server-ip 192.168.66.128. \[SW6\]interface vlanif 4029. \[SW6-Vlanif40\]dhcp select relay30. \[SW6-Vlanif40\]dhcp relay server-ip 192.168.66.1
2 弹性路由网络设计
2.1 需求
1)如图连接网络设备,规划 VLAN 信息
2)规划 OSPF 骨干区域
3)每个 VLAN 规划到不同的 OSPF 区域
4)通过 OSPF 产生默认路由
2.2 方案
搭建实验环境,如图 - 2 所示。

图 - 2
2.3 步骤
实现此案例需要按照如下步骤进行。
1)将 SW5、R1、SW6 配置为 OSPF 骨干区域(R1)
1. \[R1\]interface gi0/0/02. \[R1-GigabitEthernet0/0/0\]ip address 192.168.15.1 243. \[R1-GigabitEthernet0/0/0\]quit4. \[R1\]interface gi0/0/25. \[R1-GigabitEthernet0/0/2\]ip address 192.168.16.1 246. \[R1-GigabitEthernet0/0/2\]quit7. \[R1\]ospf 1 router-id 1.1.1.18. \[R1-ospf-1\]area 09. \[R1-ospf-1-area-0.0.0.0\]network 192.168.15.0 0.0.0.25510. \[R1-ospf-1-area-0.0.0.0\]network 192.168.16.0 0.0.0.25511. \[R1-ospf-1-area-0.0.0.0\]quit
2)将 SW5、R1、SW6 配置为 OSPF 骨干区域(SW5)
1. \[SWx\]vlan batch 15 16 // x 是每个交换机的名字2. \[SW5\]interface vlanif 153. \[SW5-Vlanif15\]ip address 192.168.15.5 244. \[SW5-Vlanif15\]quit5. \[SW7\]interface gi0/0/156. \[SW7-GigabitEthernet0/0/15\]port link-type access7. \[SW7-GigabitEthernet0/0/15\]port default vlan 158. \[SW5\]ospf 1 router-id 5.5.5.59. \[SW5-ospf-1\]area 010. \[SW5-ospf-1-area-0.0.0.0\]network 192.168.15.0 0.0.0.25511. \[SW5-ospf-1-area-0.0.0.0\]quit
3)将 SW5、R1、SW6 配置为 OSPF 骨干区域(SW6)
1. \[SWx\]vlan batch 15 16 // x 是每个交换机的名字2. \[SW6\]interface vlanif 163. \[SW6-Vlanif16\]ip address 192.168.16.6 244. \[SW6-Vlanif16\]quit5. \[SW8\]interface gi0/0/166. \[SW8-GigabitEthernet0/0/16\]port link-type access7. \[SW8-GigabitEthernet0/0/16\]port default vlan 168. \[SW6\]ospf 1 router-id 6.6.6.69. \[SW6-ospf-1\]area 010. \[SW6-ospf-1-area-0.0.0.0\]network 192.168.16.0 0.0.0.25511. \[SW6-ospf-1-area-0.0.0.0\]quit
4)在 SW5 上,宣告客户的 VLAN 进入 OSPF 协议
1. \[SW5\]ospf 12. \[SW5-ospf-1\]area 103. \[SW5-ospf-1-area-0.0.0.10\]network 192.168.10.0 0.0.0.2554. \[SW5-ospf-1-area-0.0.0.10\]quit5. \[SW5-ospf-1\]area 206. \[SW5-ospf-1-area-0.0.0.20\]network 192.168.20.0 0.0.0.2557. \[SW5-ospf-1-area-0.0.0.20\]quit8. \[SW5-ospf-1\]area 309. \[SW5-ospf-1-area-0.0.0.30\]network 192.168.30.0 0.0.0.25510. \[SW5-ospf-1-area-0.0.0.30\]quit11. \[SW5-ospf-1\]area 4012. \[SW5-ospf-1-area-0.0.0.40\]network 192.168.40.0 0.0.0.25513. \[SW5-ospf-1-area-0.0.0.40\]quit
5)在 SW6 上,宣告客户的 VLAN 进入 OSPF 协议
1. \[SW6\]ospf 12. \[SW6-ospf-1\]area 103. \[SW6-ospf-1-area-0.0.0.10\]network 192.168.10.0 0.0.0.2554. \[SW6-ospf-1-area-0.0.0.10\]quit5. \[SW6-ospf-1\]area 206. \[SW6-ospf-1-area-0.0.0.20\]network 192.168.20.0 0.0.0.2557. \[SW6-ospf-1-area-0.0.0.20\]quit8. \[SW6-ospf-1\]area 309. \[SW6-ospf-1-area-0.0.0.30\]network 192.168.30.0 0.0.0.25510. \[SW6-ospf-1-area-0.0.0.30\]quit11. \[SW6-ospf-1\]area 4012. \[SW6-ospf-1-area-0.0.0.40\]network 192.168.40.0 0.0.0.25513. \[SW6-ospf-1-area-0.0.0.40\]quit14. \[SW6-ospf-1\]area 6615. \[SW6-ospf-1-area-0.0.0.66\]network 192.168.66.0 0.0.0.25516. \[SW6-ospf-1-area-0.0.0.66\]quit
6)在 R1 上,通过 OSPF 宣告默认路由到内网
1. \[R1\]interface gi0/0/02. \[R1-GigabitEthernet0/0/0\]ip address 100.1.1.1 243. \[R1-GigabitEthernet0/0/0\]quit5. \[R1\]ip route-static 0.0.0.0 0 100.1.1.3 247. \[R1\]ospf 18. \[R1-ospf-1\] default-route-advertise
3 双出口 Internet 访问实现
3.1 需求
1)如图连接设备,规划 VLAN 信息
2)R1 作为内网的主出口,R2 作为内网的备份出口
3)部署 NAT,实现内网到外网的互通,确保节省公网 IP 地址
3.2 方案
搭建实验环境,如图 - 3 所示。

图 - 3
3.3 步骤
实现此案例需要按照如下步骤进行。
1)将 SW5、R2、SW6 配置为 OSPF 骨干区域(R2)
1. \[R2\]interface gi0/0/02. \[R2-GigabitEthernet0/0/0\]ip address 192.168.25.2 243. \[R2-GigabitEthernet0/0/0\]quit5. \[R2\]interface gi0/0/16. \[R2-GigabitEthernet0/0/1\]ip address 192.168.26.2 247. \[R2-GigabitEthernet0/0/1\]quit9. \[R2\]ospf 1 router-id 2.2.2.210. \[R2-ospf-1\]area 011. \[R2-ospf-1-area-0.0.0.0\]network 192.168.25.0 0.0.0.25512. \[R2-ospf-1-area-0.0.0.0\]network 192.168.26.0 0.0.0.25513. \[R2-ospf-1-area-0.0.0.0\]quit
2)将 SW5、R2、SW6 配置为 OSPF 骨干区域(SW5)
1. \[SWx\]vlan batch 25 26 // x 是每个交换机的名字2. \[SW5\]interface vlanif 253. \[SW5-Vlanif25\]ip address 192.168.25.5 244. \[SW5-Vlanif25\]quit6. \[SW7\]interface gi0/0/167. \[SW7-GigabitEthernet0/0/16\]port link-type access8. \[SW7-GigabitEthernet0/0/16\]port default vlan 2510. \[SW5\]ospf 111. \[SW5-ospf-1\]area 012. \[SW5-ospf-1-area-0.0.0.0\]network 192.168.25.0 0.0.0.25513. \[SW5-ospf-1-area-0.0.0.0\]quit
3)将 SW5、R2、SW6 配置为 OSPF 骨干区域(SW6)
1. \[SWx\]vlan batch 25 26 // x 是每个交换机的名字2. \[SW6\]interface vlanif 263. \[SW6-Vlanif26\]ip address 192.168.26.6 244. \[SW6-Vlanif26\]quit6. \[SW8\]interface gi0/0/177. \[SW8-GigabitEthernet0/0/17\]port link-type access8. \[SW8-GigabitEthernet0/0/17\]port default vlan 2610. \[SW6\]ospf 111. \[SW6-ospf-1\]area 012. \[SW6-ospf-1-area-0.0.0.0\]network 192.168.26.0 0.0.0.25513. \[SW6-ospf-1-area-0.0.0.0\]quit
4)在 R2 上,通过 OSPF 宣告默认路由到内网,并增加开销值
1. \[R2\]interface gi0/0/22. \[R2-GigabitEthernet0/0/2\]ip address 200.1.1.2 243. \[R2-GigabitEthernet0/0/2\]quit5. \[R2\]ip route-static 0.0.0.0 0 200.1.1.3 247. \[R2\]ospf 18. \[R2-ospf-1\] default-route-advertise cost 10
5)在 R1 上配置 NAT(EasyIP),实现内网到外网的互通
1. \[R1\]acl 20002. \[R1-acl-basic-2000\]rule 10 deny source 192.168.40.0 0.0.0.2553. \[R1-acl-basic-2000\]rule 20 permit source any4. \[R1-acl-basic-2000\]quit6. \[R1\]interface gi0/0/17. \[R1-GigabitEthernet0/0/1\]nat outbound 20008. \[R1-GigabitEthernet0/0/1\]quit
6)在 R2 上配置 NAT(EasyIP),实现内网到外网的互通
1. \[R2\]acl 20002. \[R2-acl-basic-2000\]rule 10 deny source 192.168.40.0 0.0.0.2553. \[R2-acl-basic-2000\]rule 20 permit source any4. \[R2-acl-basic-2000\]quit6. \[R2\]interface gi0/0/27. \[R2-GigabitEthernet0/0/2\]nat outbound 20008. \[R2-GigabitEthernet0/0/2\]quit
4 内网服务器发布
4.1 需求
1)内网服务器可以被外网用户直接访问
2)web 服务器所在的区域,属于特殊区域,不受不稳定链路的影响
4.2 方案
搭建实验环境,如图 - 4 所示。

图 - 4
4.3 步骤
实现此案例需要按照如下步骤进行。
1)配置 Web 服务器
配置接口 IP 地址、掩码、网关
开启 Web 服务
2)配置 Web 服务器的网关接口
1. \[SW5\]interface vlanif 882. \[SW5-Vlanif88\]ip address 192.168.88.254 243. \[SW5-Vlanif88\]quit4. \[SW5\]interface gi0/0/85. \[SW5-GigabitEthernet0/0/8\]port link-type access6. \[SW5-GigabitEthernet0/0/8\]port default vlan 887. \[SW5-GigabitEthernet0/0/8\]quit
3)宣告 Web 服务器的网段进入 OSPF 网络,并配置为特殊区域
1. \[SW5\]ospf 12. \[SW5-ospf-1\]area 883. \[SW5-ospf-1-area-0.0.0.88\]network 192.168.88.0 0.0.0.2554. \[SW5-ospf-1-area-0.0.0.88\]stub no-summary
3)在边界设备上,配置 NAT Server,实现内部服务器的发布
1. \[R1\]interface gi0/0/12. \[R1-GigabitEthernet0/0/1\]nat server protocol tcp global 100.1.1.10 80 inside 192.168.88.1 803. \[R2\]interface gi0/0/24. \[R2-GigabitEthernet0/0/2\]nat server protocol tcp global 200.1.1.10 80 inside 192.168.88.1 80
5 设备远程管理
5.1 需求
1)内网中的 SW1/2/3/4 需要被外网用户远程管理
2)内网交换设备的管理 VLAN 是 199(192.168.199.0/24)
3)内网交换设备的远程管理账户和密码是:HCIE/HuaWei
5.2 方案
搭建实验环境,如图 - 5 所示。

图 - 5
5.3 步骤
实现此案例需要按照如下步骤进行。
1)配置 SW1/2/3/4 的管理 IP 地址,并配置默认路由 / 网关
1. \[SWx\]vlan batch 199 // x为每个交换机的号码2. \[SW5\]interface vlanif 1993. \[SW5-Vlanif199\]ip address 192.168.199.251 244. \[SW5-Vlanif199\]vrrp vrid 199 virtual-ip 192.168.199.2545. \[SW5-Vlanif199\]vrrp vrid 199 priority 2006. \[SW5-Vlanif199\]quit7. \[SW6\]interface vlanif 1998. \[SW6-Vlanif199\]ip address 192.168.199.252 249. \[SW6-Vlanif199\]vrrp vrid 199 virtual-ip 192.168.199.25410. \[SW6-Vlanif199\]quit
2)配置 SW1 的管理 IP 地址,并配置默认路由 / 网关
1. \[SW1\]interface vlanif 1992. \[SW1-Vlanif199\]ip address 192.168.199.1 243. \[SW1-Vlanif199\]quit4. \[SW1\]user-interface vty 0 45. \[SW1-ui-vty0-4\]authentication-mode aaa6. \[SW1-ui-vty0-4\]quit7. \[SW1\]aaa8. \[SW1-aaa\]local-user HCIE password cipher HuaWei9. \[SW1-aaa\]local-user HCIE service-type telnet10. \[SW1-aaa\]quit11. \[SW1\]ip route-static 0.0.0.0 0 192.168.199.254
3)配置 SW2 的管理 IP 地址,并配置默认路由 / 网关
1. \[SW2\]interface vlanif 1992. \[SW2-Vlanif199\]ip address 192.168.199.2 243. \[SW2-Vlanif199\]quit4. \[SW2\]user-interface vty 0 45. \[SW2-ui-vty0-4\]authentication-mode aaa6. \[SW2-ui-vty0-4\]quit7. \[SW2\]aaa8. \[SW2-aaa\]local-user HCIE password cipher HuaWei9. \[SW2-aaa\]local-user HCIE service-type telnet10. \[SW2-aaa\]quit11. \[SW2\]ip route-static 0.0.0.0 0 192.168.199.254
4)配置 SW3 的管理 IP 地址,并配置默认路由 / 网关
1. \[SW3\]interface vlanif 1992. \[SW3-Vlanif199\]ip address 192.168.199.3 243. \[SW3-Vlanif199\]quit4. \[SW3\]user-interface vty 0 45. \[SW3-ui-vty0-4\]authentication-mode aaa6. \[SW3-ui-vty0-4\]quit7. \[SW3\]aaa8. \[SW3-aaa\]local-user HCIE password cipher HuaWei9. \[SW3-aaa\]local-user HCIE service-type telnet10. \[SW3-aaa\]quit11. \[SW3\]ip route-static 0.0.0.0 0 192.168.199.254
5)配置 SW4 的管理 IP 地址,并配置默认路由 / 网关
1. \[SW4\]interface vlanif 1992. \[SW4-Vlanif199\]ip address 192.168.199.4 243. \[SW4-Vlanif199\]quit4. \[SW4\]user-interface vty 0 45. \[SW4-ui-vty0-4\]authentication-mode aaa6. \[SW4-ui-vty0-4\]quit7. \[SW4\]aaa8. \[SW4-aaa\]local-user HCIE password cipher HuaWei9. \[SW4-aaa\]local-user HCIE service-type telnet10. \[SW4-aaa\]quit11. \[SW4\]ip route-static 0.0.0.0 0 192.168.199.254
6)配置 SW5/6,宣告 VLAN 199 的网段进入 OSPF 网络
1. \[SW5\]ospf 12. \[SW5-ospf-1\]area 1993. \[SW5-ospf-1-area-0.0.0.199\]network 192.168.199.0 0.0.0.2554. \[SW5-ospf-1-area-0.0.0.199\]6. \[SW6\]ospf 17. \[SW6-ospf-1\]area 1998. \[SW6-ospf-1-area-0.0.0.199\]network 192.168.199.0 0.0.0.2559. \[SW6-ospf-1-area-0.0.0.199\]
7)在边界设备上配置 NAT server,实现内网服务器的发布
1. \[R1\]interface gi0/0/12. \[R1-GigabitEthernet0/0/1\]nat server protocol tcp global 100.1.1.10 2001 inside 192.168.199.1 233. \[R1-GigabitEthernet0/0/1\]nat server protocol tcp global 100.1.1.10 2002 inside 192.168.199.2 234. \[R1-GigabitEthernet0/0/1\]nat server protocol tcp global 100.1.1.10 2002 inside 192.168.199.3 235. \[R1-GigabitEthernet0/0/1\]nat server protocol tcp global 100.1.1.10 2002 inside 192.168.199.4 236. \[R2\]interface gi0/0/27. \[R2-GigabitEthernet0/0/2\]nat server protocol tcp global 200.1.1.10 2001 inside 192.168.199.1 238. \[R2-GigabitEthernet0/0/2\]nat server protocol tcp global 200.1.1.10 2002 inside 192.168.199.2 239. \[R2-GigabitEthernet0/0/2\]nat server protocol tcp global 200.1.1.10 2002 inside 192.168.199.3 2310. \[R2-GigabitEthernet0/0/2\]nat server protocol tcp global 200.1.1.10 2002 inside 192.168.199.4 23
8)在边界设备上配置 NAT server,实现内网服务器的发布
1. \[R1\]interface gi0/0/22. \[R1-GigabitEthernet0/0/2\]ospf cost 10
9)在边界设备上配置 NAT server,实现内网服务器的发布
1. \[R2\]interface gi0/0/12. \[R2-GigabitEthernet0/0/1\]ospf cost 10
https://tts.tmooc.cn/ttsPage/NTD/NTDTN202109/PROJECT2/DAY02/CASE/01/index.html
