123456

HCIP中期考试考题与eNSP配置

实验背景

本次实验为企业园区网络综合配置,结合前期课程学习的 VLAN、链路聚合、STP、VRRP、OSPF、单臂路由等技术,完成企业网络的部署,实现全网连通与冗余可靠性,覆盖中期考试前的全部核心知识点。

拓扑与 IP 规划

已提供的 IP 地址规划如下,拓扑为核心路由器全互联 + 分层汇聚的园区网络结构:

|---------|-----------------------------------------------------------------------|----------------------------------|-----------------------------------------------------------------------------------------------------------|
| 设备 | 网段 | 网关 | 备注 |
| PC1 | 192.168.1.0/24(192.168.1.0/24) | 192.168.1.254(192.168.1.254) | IP : 192.168.1.1(192.168.1.1) |
| PC2 | 192.168.1.0/24(192.168.1.0/24) | 192.168.1.254(192.168.1.254) | IP : 192.168.1.2(192.168.1.2) |
| PC3 | 192.168.2.0/24(192.168.2.0/24) | 192.168.2.254(192.168.2.254) | IP : 192.168.2.1(192.168.2.1) |
| PC4 | 192.168.2.0/24(192.168.2.0/24) | 192.168.2.254(192.168.2.254) | IP : 192.168.2.2(192.168.2.2) |
| PC5 | 192.168.3.0/24(192.168.3.0/24) | 192.168.3.254(192.168.3.254) | IP : 192.168.3.1/vlan10(192.168.3.1/vlan10) |
| PC6 | 192.168.4.0/24(192.168.4.0/24) | 192.168.4.254(192.168.4.254) | IP : 192.168.4.1/vlan20(192.168.4.1/vlan20) |
| R3-R4 | 192.168.100.0/30(192.168.100.0/30) | - | R3:192.168.100.1/30(192.168.100.1/30) ; R4:192.168.100.2/30(192.168.100.2/30) |
| R3-R2 | 192.168.100.4/30(192.168.100.4/30) | - | R2:192.168.100.5/30(192.168.100.5/30) ; R3:192.168.100.6/30(192.168.100.6/30) |
| R3-R1 | 192.168.100.8/30(192.168.100.8/30) | - | R1:192.168.100.9/30(192.168.100.9/30) ; R3:192.168.100.10/30(192.168.100.10/30) |
| R2-R4 | 192.168.100.12/30(192.168.100.12/30) | - | R2:192.168.100.13/30(192.168.100.13/30) ; R4:192.168.100.14/30(192.168.100.14/30) |
| R1-R4 | 192.168.100.16/30(192.168.100.16/30) | - | R1:192.168.100.17/30(192.168.100.17/30) ; R4:192.168.100.18/30(192.168.100.18/30) |
| R1-R2 | 192.168.100.20/30(192.168.100.20/30) | - | R1:192.168.100.21/30(192.168.100.21/30) ; R2:192.168.100.22/30(192.168.100.22/30) |
| R1-R5 | 10.10.10.0/30(10.10.10.0/30) | - | R1:10.10.10.1/30(10.10.10.1/30) ; R5:10.10.10.2/30(10.10.10.2/30) |
| R1-R6 | 10.10.10.4/30(10.10.10.4/30) | - | R1:10.10.10.5/30(10.10.10.5/30) ; R6:10.10.10.6/30(10.10.10.6/30) |
| R2-R5 | 10.10.10.8/30(10.10.10.8/30) | - | R2:10.10.10.9/30;(10.10.10.9/30;) R5:10.10.10.10/30(10.10.10.10/30) |
| R2-R6 | 10.10.10.12/30(10.10.10.12/30) | - | R2:10.10.10.13/30;(10.10.10.13/30;) R6:10.10.10.14/30(10.10.10.14/30) |
| R5-R6 | 10.10.10.16/30(10.10.10.16/30) | - | R5:10.10.10.17/30;(10.10.10.17/30;) R6:10.10.10.18/30(10.10.10.18/30) |
| R5-R7 | 10.10.10.20/30(10.10.10.20/30) | - | R5:10.10.10.21/30;(10.10.10.21/30;) R7:10.10.10.22/30(10.10.10.22/30) |
| R6-R7 | 10.10.10.24/30(10.10.10.24/30) | - | R6:10.10.10.25/30;(10.10.10.25/30;) R7:10.10.10.26/30(10.10.10.26/30) |
| R7-R8 | 10.10.10.28/30(10.10.10.28/30) | - | R7:10.10.10.29/30;(10.10.10.29/30;) R8:10.10.10.30/30(10.10.10.30/30) |
| R8-R9 | 10.10.10.32/30(10.10.10.32/30) | - | R7:10.10.10.33/30;(10.10.10.33/30;) R8:10.10.10.34/30(10.10.10.34/30) |
| R9-R10 | 192.168.200.0/30(192.168.200.0/30) | - | R9:192.168.200.2(192.168.200.2) ; R10 : 192.168.200.1(192.168.200.1) |
| R10 子接口 | 192.168.3.0/24(192.168.3.0/24)、192.168.4.0/24(192.168.4.0/24) | - | GE0/0/1.1 (vlan10):192.168.3.254(192.168.3.254) ; GE0/0/1.2 (vlan20):192.168.4.254(192.168.4.254) |

实验要求

  1. 终端配置:所有 PC 按照规划配置 IP 地址、子网掩码和网关。

  2. VLAN 与 Trunk 配置

    1. 将 PC1、PC2 划分至 VLAN 10,PC3、PC4 划分至 VLAN 20;

    2. 将 PC5 划分至 VLAN 10,PC6 划分至 VLAN 20;

    3. 接入交换机与核心路由器、R10 相连的接口配置为 Trunk 类型,允许所有 VLAN 通过。

  3. 链路聚合配置

    1. 接入交换机 SW1 与 R3、R4 相连的两条链路配置为静态链路聚合,实现链路负载分担与冗余。
  4. STP 配置

    1. 配置 STP 防止二层环路,指定 R3 为根桥,避免网络环路问题。
  5. VRRP 配置

    1. 在 R3 和 R4 上配置 VRRP 实现网关冗余:

      • VLAN10 的虚拟网关为 192.168.1.254(192.168.1.254),R3 为主网关(优先级 120),R4 为备份网关;

      • VLAN20 的虚拟网关为 192.168.2.254(192.168.2.254),R4 为主网关(优先级 120),R3 为备份网关;

      • 实现网关的负载分担与故障自动切换。

  6. 单臂路由配置

    1. 在 R10 上配置子接口,实现右侧 VLAN 间的路由,子接口 IP 按照规划配置。
  7. OSPF 配置

    1. 所有路由器运行 OSPF 协议,进程号为 1,所有接口属于区域 0;

    2. 将所有直连网段宣告进 OSPF,保证全网路由可达。

  8. 验证要求

    1. 所有 PC 之间可以互相 ping 通,验证全网连通性;

    2. 断开 R3 设备,验证 VLAN10 的业务可以自动切换到 R4,业务不中断;

    3. 断开 R4 设备,验证 VLAN20 的业务可以自动切换到 R3,业务不中断。


华为 eNSP 配置代码

以下为各设备的完整配置命令,可直接在 eNSP 中导入或手动执行:

1. 左侧接入交换机 SW1

复制代码

system-view sysname SW1 # 创建所需VLAN vlan batch 10 20 # 配置连接PC的Access接口 interface GigabitEthernet0/0/1 port link-type access port default vlan 10 # interface GigabitEthernet0/0/2 port link-type access port default vlan 10 # interface GigabitEthernet0/0/3 port link-type access port default vlan 20 # interface GigabitEthernet0/0/4 port link-type access port default vlan 20 # 配置静态链路聚合 interface Eth-Trunk 1 port link-type trunk port trunk allow-pass vlan all mode manual load-balance # interface GigabitEthernet0/0/5 eth-trunk 1 # interface GigabitEthernet0/0/6 eth-trunk 1 # STP配置,设置为备份根桥 stp root secondary quit

2. 右侧接入交换机 SW2

复制代码

system-view sysname SW2 vlan batch 10 20 # 连接PC的Access接口 interface GigabitEthernet0/0/1 port link-type access port default vlan 10 # interface GigabitEthernet0/0/2 port link-type access port default vlan 20 # 连接R10的Trunk接口 interface GigabitEthernet0/0/3 port link-type trunk port trunk allow-pass vlan all quit

3. 核心路由器 R3

复制代码

system-view sysname R3 # 开启STP,设置为根桥 stp enable stp root primary # 配置链路聚合接口 interface Eth-Trunk 1 port link-type trunk port trunk allow-pass vlan all mode manual load-balance # interface GigabitEthernet0/0/1 eth-trunk 1 # interface GigabitEthernet0/0/2 eth-trunk 1 # 配置VLANIF接口与VRRP interface Vlanif10 ip address 192.168.1.253 255.255.255.0 vrrp vrid 1 virtual-ip 192.168.1.254 vrrp vrid 1 priority 120 # interface Vlanif20 ip address 192.168.2.253 255.255.255.0 vrrp vrid 2 virtual-ip 192.168.2.254 # 核心互联接口IP配置 interface GigabitEthernet0/0/3 ip address 192.168.100.1 255.255.255.252 # 连接R4 # interface GigabitEthernet0/0/4 ip address 192.168.100.6 255.255.255.252 # 连接R2 # interface GigabitEthernet0/0/5 ip address 192.168.100.10 255.255.255.252 # 连接R1 # OSPF配置 ospf 1 router-id 3.3.3.3 area 0 network 192.168.1.0 0.0.0.255 network 192.168.2.0 0.0.0.255 network 192.168.100.0 0.0.0.255 quit

4. 核心路由器 R4

复制代码

system-view sysname R4 stp enable # 链路聚合配置 interface Eth-Trunk 1 port link-type trunk port trunk allow-pass vlan all mode manual load-balance # interface GigabitEthernet0/0/1 eth-trunk 1 # interface GigabitEthernet0/0/2 eth-trunk 1 # VLANIF与VRRP配置 interface Vlanif10 ip address 192.168.1.254 255.255.255.0 vrrp vrid 1 virtual-ip 192.168.1.254 # interface Vlanif20 ip address 192.168.2.254 255.255.255.0 vrrp vrid 2 virtual-ip 192.168.2.254 vrrp vrid 2 priority 120 # 核心互联接口 interface GigabitEthernet0/0/3 ip address 192.168.100.2 255.255.255.252 # 连接R3 # interface GigabitEthernet0/0/4 ip address 192.168.100.14 255.255.255.252 # 连接R2 # interface GigabitEthernet0/0/5 ip address 192.168.100.18 255.255.255.252 # 连接R1 # OSPF配置 ospf 1 router-id 4.4.4.4 area 0 network 192.168.1.0 0.0.0.255 network 192.168.2.0 0.0.0.255 network 192.168.100.0 0.0.0.255 quit

5. 核心路由器 R1

复制代码

system-view sysname R1 # 核心互联接口 interface GigabitEthernet0/0/1 ip address 192.168.100.9 255.255.255.252 # 连接R3 # interface GigabitEthernet0/0/2 ip address 192.168.100.17 255.255.255.252 # 连接R4 # interface GigabitEthernet0/0/3 ip address 192.168.100.21 255.255.255.252 # 连接R2 # 汇聚侧互联接口 interface GigabitEthernet0/0/4 ip address 10.10.10.1 255.255.255.252 # 连接R5 # interface GigabitEthernet0/0/5 ip address 10.10.10.5 255.255.255.252 # 连接R6 # OSPF配置 ospf 1 router-id 1.1.1.1 area 0 network 192.168.100.0 0.0.0.255 network 10.10.10.0 0.0.0.255 quit

6. 核心路由器 R2

复制代码

system-view sysname R2 # 核心互联接口 interface GigabitEthernet0/0/1 ip address 192.168.100.5 255.255.255.252 # 连接R3 # interface GigabitEthernet0/0/2 ip address 192.168.100.13 255.255.255.252 # 连接R4 # interface GigabitEthernet0/0/3 ip address 192.168.100.22 255.255.255.252 # 连接R1 # 汇聚侧互联接口 interface GigabitEthernet0/0/4 ip address 10.10.10.9 255.255.255.252 # 连接R5 # interface GigabitEthernet0/0/5 ip address 10.10.10.13 255.255.255.252 # 连接R6 # OSPF配置 ospf 1 router-id 2.2.2.2 area 0 network 192.168.100.0 0.0.0.255 network 10.10.10.0 0.0.0.255 quit

7. 汇聚路由器 R5

复制代码

system-view sysname R5 # 互联接口配置 interface GigabitEthernet0/0/1 ip address 10.10.10.2 255.255.255.252 # 连接R1 # interface GigabitEthernet0/0/2 ip address 10.10.10.10 255.255.255.252 # 连接R2 # interface GigabitEthernet0/0/3 ip address 10.10.10.17 255.255.255.252 # 连接R6 # interface GigabitEthernet0/0/4 ip address 10.10.10.21 255.255.255.252 # 连接R7 # OSPF配置 ospf 1 router-id 5.5.5.5 area 0 network 10.10.10.0 0.0.0.255 quit

8. 汇聚路由器 R6

复制代码

system-view sysname R6 # 互联接口配置 interface GigabitEthernet0/0/1 ip address 10.10.10.6 255.255.255.252 # 连接R1 # interface GigabitEthernet0/0/2 ip address 10.10.10.14 255.255.255.252 # 连接R2 # interface GigabitEthernet0/0/3 ip address 10.10.10.18 255.255.255.252 # 连接R5 # interface GigabitEthernet0/0/4 ip address 10.10.10.25 255.255.255.252 # 连接R7 # OSPF配置 ospf 1 router-id 6.6.6.6 area 0 network 10.10.10.0 0.0.0.255 quit

9. 汇聚路由器 R7

复制代码

system-view sysname R7 # 互联接口配置 interface GigabitEthernet0/0/1 ip address 10.10.10.22 255.255.255.252 # 连接R5 # interface GigabitEthernet0/0/2 ip address 10.10.10.26 255.255.255.252 # 连接R6 # interface GigabitEthernet0/0/3 ip address 10.10.10.29 255.255.255.252 # 连接R8 # OSPF配置 ospf 1 router-id 7.7.7.7 area 0 network 10.10.10.0 0.0.0.255 quit

10. 汇聚路由器 R8

复制代码

system-view sysname R8 # 互联接口配置 interface GigabitEthernet0/0/0 ip address 10.10.10.30 255.255.255.252 # 连接R7 # interface GigabitEthernet0/0/1 ip address 10.10.10.34 255.255.255.252 # 连接R9 # OSPF配置 ospf 1 router-id 8.8.8.8 area 0 network 10.10.10.0 0.0.0.255 quit

11. 汇聚路由器 R9

复制代码

system-view sysname R9 # 互联接口配置 interface GigabitEthernet0/0/0 ip address 10.10.10.38 255.255.255.252 # 连接R8 # interface GigabitEthernet0/0/1 ip address 192.168.200.2 255.255.255.252 # 连接R10 # OSPF配置 ospf 1 router-id 9.9.9.9 area 0 network 10.10.10.0 0.0.0.255 network 192.168.200.0 0.0.0.255 quit

12. 接入路由器 R10(单臂路由)

复制代码

system-view sysname R10 # 连接R9的接口 interface GigabitEthernet0/0/0 ip address 192.168.200.1 255.255.255.252 # 单臂路由子接口配置 interface GigabitEthernet0/0/1.1 dot1q termination vid 10 ip address 192.168.3.254 255.255.255.0 # interface GigabitEthernet0/0/1.2 dot1q termination vid 20 ip address 192.168.4.254 255.255.255.0 # OSPF配置 ospf 1 router-id 10.10.10.10 area 0 network 192.168.3.0 0.0.0.255 network 192.168.4.0 0.0.0.255 network 192.168.200.0 0.0.0.255 quit

13. PC 终端配置

所有 PC 手动配置 IP 参数,以 PC1 为例:

  • IP 地址:192.168.1.1(192.168.1.1)

  • 子网掩码:255.255.255.0(255.255.255.0)

  • 网关:192.168.1.254(192.168.1.254)

  • DNS:可配置公共 DNS 如 8.8.8.8(8.8.8.8)

其余 PC 按照 IP 规划表对应配置即可。


配置验证

完成所有配置后,可通过以下命令验证配置有效性:

  1. 查看 VRRP 状态:display vrrp

  2. 查看 OSPF 邻居:display ospf peer

  3. 查看链路聚合状态:display eth-trunk 1

  4. 查看 STP 状态:display stp

  5. PC 之间互相 ping 测试,验证全网连通性与故障切换功能。

相关推荐
IT WorryFree10 分钟前
FortiGate 排错常用OID速查表(含Trap OID+轮询OID)
运维·网络
m0_7381207210 分钟前
渗透测试基础——基于Docker的Rsync服务靶场搭建与原理讲解
运维·服务器·网络·安全·web安全·docker·容器
CoreTK芯通康EMC整改26 分钟前
PCB 信号回流路径 EMC 失效深度解析:原理、误区与量产级整改方案
网络·经验分享·安全·emc整改案例·emc整改
asdfg125896329 分钟前
运营商的路由器到路由器之间是如何传输的
网络·智能路由器
代码中介商38 分钟前
HTTP进化史:从1.0到3.0的核心变革
网络·网络协议·http
ZStack开发者社区1 小时前
ZSTACK · 答客问 | 什么时候该升级,什么时候再等等
网络·云计算
MXsoft6181 小时前
**混合云统一监控实践:私有云+公有云的一体化运维方案**
运维·网络·数据库
天南散修1 小时前
MT7916驱动中802.11转换为802.3
linux·网络·驱动开发·wifi·802.11
其实防守也摸鱼1 小时前
无线网络安全--10 规避WLAN验证之挫败MAC地址限制
网络·智能路由器·php·教程·虚拟机·wlan·无线网络安全
xiaoxiaoxiaolll1 小时前
《Nature Communications》亮点文章:自供电双窄带OPD如何实现1.25 Mbps下的抗窃听光通信?
网络