华为数通 · IP 认证 · L3 实验

华为数据通信 L3 实验三题合订本
完整配置版

来源:三个 eNSP 工程包(mstp11 / 20267月L3 / L3实操VRRP+OSPF+EBGP) | 本版工作:把三个实验中未完成 / 未闭环 / 有笔误的配置全部补齐,整理成可直接照敲的完整配置
共 3 道实验 · 17 台设备 · 15 处改动 | 所有代码块均为纯净可粘贴的华为 VRP 命令(不含注释),点击右上角按钮即可复制

目 录

  1. 改动总览(15 处)
  2. 实验一 mstp11:MSTP 双实例负载分担
  3. 实验二 20267月L3:ISIS + iBGP + PPPoE + NAT
  4. 实验三 L3实操:VRRP + OSPF + EBGP(含 IPv6 双栈)
  5. 附录 A 三题考点对照
  6. 附录 B 三题通用排错顺序
  7. 附录 C 易错点提醒

改动总览CHANGES OVERVIEW

相对三个原始 eNSP 工程的全部改动。类型说明:修正改错了的配置,补齐缺失的配置。

#实验设备类型内容
1mstp11LSW1补齐全部二层配置 + MSTP 域 + 实例 1 主根/实例 2 备根
2mstp11LSW2补齐全部二层配置 + MSTP 域 + 实例 2 主根/实例 1 备根
3mstp11LSW3补齐全部二层配置 + 边缘端口 + BPDU 保护
4mstp11AR3修正LoopBack0 由 1.1.1.1 改为 3.3.3.3(原与 AR1 冲突)
5mstp11AR1修正OSPF network 100.1.1.0 → 100.100.100.0(原网段写错,宣告不生效)
6mstp11AR2修正删除空子接口 GE0/0/1.10
7mstp11AR2补齐ACL 2002 + nat outbound + 默认路由(原 PC2 完全不能上外网)
820267月L3LSW1补齐VLAN 100/200 + Access/Trunk + Eth-Trunk10
920267月L3LSW2补齐VLAN 200/300 + Access/Trunk + Eth-Trunk10
1020267月L3ISP补齐PPPoE Server(地址池 + CHAP 认证 + Virtual-Template)
1120267月L3AR1补齐dialer-rule + Dialer0 的 dialer-group(缺这条 PPPoE 起不来)
1220267月L3AR1修正ACL 2000 补上总部网段 192.168.100.0/24(原只有分部网段)
13L3实操R2补齐BGP 增加 network 10.1.1.0 255.255.255.248(原 PC1 到 PC3 不通)
14L3实操SW1/SW2补齐STP 根桥规划 + VRRP 上行链路跟踪
15L3实操SW2修正删除残留 port-group trunfka;修正两处 description 笔误

第一部分 mstp11:MSTP 双实例负载分担LAB 1

VLAN10 走 LSW1、VLAN20 走 LSW2 的双实例负载分担实验,含边缘端口、BPDU 保护、单臂路由与双出口 NAT 上网。

1.1 拓扑

10.0.12.0/30100.100.100.0/30192.168.11.0/24192.168.22.0/24vlan10vlan20192.168.11.1/24192.168.22.1/24GE0/0/0GE0/0/2GE0/0/0GE0/0/0GE0/0/1GE0/0/1GE0/0/1GE0/0/1GE0/0/2GE0/0/1GE0/0/2GE0/0/2GE0/0/3GE0/0/3GE0/0/3Eth0/0/0GE0/0/4Eth0/0/0AR3模拟 ISPAR1AR2LSW1实例1主根LSW2实例2主根LSW3接入层PC1PC2
实验一拓扑 AR1/AR2 双出口网关,LSW1/LSW2 双根桥互联,LSW3 接入 PC1/PC2(还原自 eNSP 工程包 mstp11.topo)

1.2 地址规划

设备接口地址
AR3GE0/0/0100.100.100.2/30
AR3LoopBack03.3.3.3/32
AR1GE0/0/010.0.12.1/30
AR1GE0/0/1.10192.168.11.254/24(VLAN10 网关)
AR1GE0/0/2100.100.100.1/30,NAT
AR1LoopBack01.1.1.1/32
AR2GE0/0/010.0.12.2/30
AR2GE0/0/1.20192.168.22.254/24(VLAN20 网关)
AR2LoopBack02.2.2.2/32
PC1—192.168.11.1/24,网关 .254,VLAN10
PC2—192.168.22.1/24,网关 .254,VLAN20

1.3 题目要求

  1. 三台交换机创建 VLAN10/20,PC 接口配 Access,交换机互联配 Trunk;
  2. MSTP 域 huawei、修订级别 1,VLAN10→实例1、VLAN20→实例2;
  3. LSW1 为实例1 主根、实例2 备根;LSW2 为实例2 主根、实例1 备根,实现 VLAN10 走 LSW1、VLAN20 走 LSW2;
  4. 接 PC 的口配边缘端口,全局开 BPDU 保护;
  5. 验证负载分担、链路故障切换、PC1/PC2 上网。

1.4 改动清单

设备改动原因
AR3LoopBack0 1.1.1.1 → 3.3.3.3与 AR1 的 LoopBack0 地址重复,会导致 ping 测试指向错误设备
AR1OSPF network 100.1.1.0 0.0.0.3 → network 100.100.100.0 0.0.0.3原网段与接口 100.100.100.1/30 不匹配,该网段根本没进 OSPF
AR2删除 interface GigabitEthernet0/0/1.10空子接口(无 vid、无地址),无意义
AR2新增 ACL 2002 + GE0/0/0 nat outbound + 默认路由原配置 PC2 无出口,访问不了 100.100.100.2
LSW1/2/3全部二层与 MSTP 配置原始工程三台交换机 flash 为空镜像,完全没配

1.5 完整配置

AR3(ISP 模拟)

[AR3]纯净可粘贴 · system-view 起步
system-view
sysname AR3

interface GigabitEthernet0/0/0
 ip address 100.100.100.2 255.255.255.252

interface LoopBack0
 ip address 3.3.3.3 255.255.255.255

AR1(VLAN10 网关 + NAT 出口)

[AR1]纯净可粘贴 · system-view 起步
system-view
sysname AR1

acl number 2001
 rule 5 permit source 192.168.11.0 0.0.0.255

interface GigabitEthernet0/0/0
 ip address 10.0.12.1 255.255.255.252

interface GigabitEthernet0/0/1.10
 dot1q termination vid 10
 ip address 192.168.11.254 255.255.255.0
 arp broadcast enable

interface GigabitEthernet0/0/2
 ip address 100.100.100.1 255.255.255.252
 nat outbound 2001

interface LoopBack0
 ip address 1.1.1.1 255.255.255.255

ospf 1 router-id 1.1.1.1
 area 0.0.0.0
  network 1.1.1.1 0.0.0.0
  network 10.0.12.0 0.0.0.3
  network 100.100.100.0 0.0.0.3
  network 192.168.11.0 0.0.0.255

ip route-static 0.0.0.0 0.0.0.0 100.100.100.2

AR2(VLAN20 网关 + NAT 出口)

[AR2]纯净可粘贴 · system-view 起步
system-view
sysname AR2

acl number 2002
 rule 5 permit source 192.168.22.0 0.0.0.255

interface GigabitEthernet0/0/0
 ip address 10.0.12.2 255.255.255.252
 nat outbound 2002

interface GigabitEthernet0/0/1.20
 dot1q termination vid 20
 ip address 192.168.22.254 255.255.255.0
 arp broadcast enable

interface LoopBack0
 ip address 2.2.2.2 255.255.255.255

ospf 1 router-id 2.2.2.2
 area 0.0.0.0
  network 2.2.2.2 0.0.0.0
  network 10.0.12.0 0.0.0.3
  network 192.168.22.0 0.0.0.255

ip route-static 0.0.0.0 0.0.0.0 10.0.12.1

LSW1(实例 1 主根 / 实例 2 备根)

[LSW1]纯净可粘贴 · system-view 起步
system-view
sysname LSW1

vlan batch 10 20

interface GigabitEthernet0/0/1
 port link-type trunk
 port trunk allow-pass vlan 10

interface GigabitEthernet0/0/2
 port link-type trunk
 port trunk allow-pass vlan 10 20

interface GigabitEthernet0/0/3
 port link-type trunk
 port trunk allow-pass vlan 10 20

stp mode mstp
stp region-configuration
 region-name huawei
 revision-level 1
 instance 1 vlan 10
 instance 2 vlan 20
 active region-configuration

stp instance 1 root primary
stp instance 2 root secondary

LSW2(实例 2 主根 / 实例 1 备根)

[LSW2]纯净可粘贴 · system-view 起步
system-view
sysname LSW2

vlan batch 10 20

interface GigabitEthernet0/0/1
 port link-type trunk
 port trunk allow-pass vlan 20

interface GigabitEthernet0/0/2
 port link-type trunk
 port trunk allow-pass vlan 10 20

interface GigabitEthernet0/0/3
 port link-type trunk
 port trunk allow-pass vlan 10 20

stp mode mstp
stp region-configuration
 region-name huawei
 revision-level 1
 instance 1 vlan 10
 instance 2 vlan 20
 active region-configuration

stp instance 2 root primary
stp instance 1 root secondary

LSW3(接入层,边缘端口 + BPDU 保护)

[LSW3]纯净可粘贴 · system-view 起步
system-view
sysname LSW3

vlan batch 10 20

interface GigabitEthernet0/0/1
 port link-type trunk
 port trunk allow-pass vlan 10 20

interface GigabitEthernet0/0/2
 port link-type trunk
 port trunk allow-pass vlan 10 20

interface GigabitEthernet0/0/3
 port link-type access
 port default vlan 10
 stp edged-port enable

interface GigabitEthernet0/0/4
 port link-type access
 port default vlan 20
 stp edged-port enable

stp mode mstp
stp region-configuration
 region-name huawei
 revision-level 1
 instance 1 vlan 10
 instance 2 vlan 20
 active region-configuration

stp bpdu-protection

1.6 预期结果与验证

实例根桥LSW3 根端口LSW3 阻塞端口
实例 1(VLAN10)LSW1(优先级 0)GE0/0/1(→LSW1)GE0/0/2(→LSW2)
实例 2(VLAN20)LSW2(优先级 0)GE0/0/2(→LSW2)GE0/0/1(→LSW1)
[LSW1] display stp region-configuration
[LSW1] display stp instance 1 brief
[LSW3] display stp instance 1 brief
[LSW3] display stp instance 2 brief
关键判据:LSW1—LSW2 的 GE0/0/3 在两个实例中都是 FORWARDING(两台根桥之间的链路永不被阻塞)。
测试预期
PC1 ping 192.168.22.1通
PC1 ping 100.100.100.2通(AR1 NAT)
PC2 ping 100.100.100.2通(AR2 NAT → AR1 → AR3)
断开 LSW3 GE0/0/1VLAN10 绕行 LSW3→LSW2→LSW1,业务恢复
断开 LSW3 GE0/0/2VLAN20 绕行 LSW3→LSW1→LSW2,业务恢复

第二部分 20267月L3:ISIS + iBGP + PPPoE + NATLAB 2

总部与分部互通 + 运营商 PPPoE 拨号上网:交换机 VLAN 与链路捆绑、ISIS 接口认证、iBGP Loopback 建邻、PPPoE Client/Server、NAT 出口。

2.1 拓扑

vlan100 · 192.168.100.0/24vlan200 · 192.168.200.0/24vlan300 · 192.168.30.0/24192.168.12.0/24LoopBack0:192.168.0.1LoopBack0:192.168.0.2PPPoEEth-Trunk10GE0/0/2Eth0/0/0GE0/0/3Eth0/0/0GE0/0/2Eth0/0/0GE0/0/3Eth0/0/0GE0/0/4GE0/0/4GE0/0/5GE0/0/5GE0/0/1GE0/0/2GE0/0/1GE0/0/2GE0/0/1GE0/0/1GE0/0/0GE0/0/0PC1PC2PC3PC4LSW1总部交换LSW2分部交换AR1总部出口AR2分部出口ISPPPPoE Server
实验二拓扑 左列 PC1-PC4 经 LSW1/LSW2(Eth-Trunk10 互联)接入 AR1/AR2,AR1 以 PPPoE 拨号接入 ISP(还原自 eNSP 工程包 20267月L3.topo)

2.2 地址与 VLAN 规划

设备接口地址 / 配置
ISPGE0/0/0PPPoE Server(Virtual-Template1,200.1.1.1/24)
ISPLoopBack08.8.8.8/32(模拟公网目标)
AR1GE0/0/0PPPoE Client(Dialer0 协商地址)
AR1GE0/0/1192.168.12.1/24
AR1GE0/0/2.100192.168.100.254/24(VLAN100 网关)
AR1LoopBack0192.168.0.1/32
AR2GE0/0/1192.168.12.2/24
AR2GE0/0/2.300192.168.30.1/24(VLAN300 网关)
AR2LoopBack0192.168.0.2/32
PC1—192.168.100.2/24,网关 .254,VLAN100
PC2—192.168.200.1/24,无网关,VLAN200
PC3—192.168.200.2/24,无网关,VLAN200
PC4—192.168.30.2/24,网关 .1,VLAN300
VLAN 划分:LSW1 = VLAN100 + VLAN200;LSW2 = VLAN200 + VLAN300。VLAN200 跨两台交换机纯二层互通(PC2 ↔ PC3),所以 Eth-Trunk 只放行 VLAN200。

2.3 题目要求(拓扑备注框原文)

模拟一个公司的总部和分部之间互通,和运营商的互通
层网络配置
1. 交换机配置 vlan 和对应的接口;配置一个链路捆绑
2. 三层网络配置,增加 igp 和 bgp 的互通
3. 和运营商互通
PPPoE 服务端和客户端
接口下 认证 电路类型 is-level cost-style nat 的配置 pppoe server 和 client
bgp 65520 用 loopback 地址建立邻居,传递内网路由,配置邻居认证

拆解成 6 个考点:

  1. 交换机:VLAN 划分 + 接口划分 + Eth-Trunk 链路捆绑;
  2. 单臂路由:AR1/AR2 用 dot1q 子接口做 VLAN100/300 网关;
  3. IGP:AR1-AR2 跑 ISIS 10,level-2、wide 度量、p2p 电路类型、接口 MD5 认证;
  4. BGP:iBGP 65520,Loopback 建邻,邻居认证,传递内网路由;
  5. 出口:AR1 做 PPPoE Client(CHAP)+ NAT + 默认路由指向 Dialer0;
  6. 运营商:ISP 侧做 PPPoE Server(地址池 + CHAP 认证)。

2.4 改动清单

设备改动原因
LSW1补 VLAN 100/200、Access/Trunk、Eth-Trunk10原 flash 为空镜像
LSW2补 VLAN 200/300、Access/Trunk、Eth-Trunk10原 flash 为空镜像
ISP补 AAA 用户、IP 地址池、Virtual-Template、PPPoE Server 绑定原工程 ISP 连配置目录都没有,PPPoE 起不来
AR1补 dialer-rule + Dialer0 的 dialer-group 1缺 dialer-group 时按需拨号不触发,PPPoE 链路起不来
AR1ACL 2000 增加 rule 5 permit source 192.168.100.0 0.0.0.255原 ACL 只有分部网段,总部自己的终端上不了网

2.5 完整配置

ISP(PPPoE Server)

[ISP]纯净可粘贴 · system-view 起步
system-view
sysname ISP

aaa
 local-user user1 password cipher user1
 local-user user1 service-type ppp

ip pool pppoe
 network 200.1.1.0 mask 255.255.255.0
 gateway-list 200.1.1.1

interface Virtual-Template1
 ppp authentication-mode chap
 remote address pool pppoe
 ip address 200.1.1.1 255.255.255.0

interface GigabitEthernet0/0/0
 pppoe-server bind virtual-template 1

interface LoopBack0
 ip address 8.8.8.8 255.255.255.255

AR1(总部出口)

[AR1]纯净可粘贴 · system-view 起步
system-view
sysname AR1

acl number 2000
 rule 5 permit source 192.168.100.0 0.0.0.255
 rule 10 permit source 192.168.30.0 0.0.0.255

isis 10
 is-level level-2
 cost-style wide
 network-entity 49.1921.6800.0000.0001.00

dialer-rule
 dialer-rule 1 ip permit

interface Dialer0
 link-protocol ppp
 ppp chap user user1
 ppp chap password simple user1
 ip address ppp-negotiate
 dialer user user1
 dialer bundle 1
 dialer-group 1
 nat outbound 2000

interface GigabitEthernet0/0/0
 pppoe-client dial-bundle-number 1

interface GigabitEthernet0/0/1
 ip address 192.168.12.1 255.255.255.0
 isis enable 10
 isis circuit-type p2p
 isis authentication-mode md5 plain zjdx

interface GigabitEthernet0/0/2.100
 dot1q termination vid 100
 ip address 192.168.100.254 255.255.255.0
 arp broadcast enable

interface LoopBack0
 ip address 192.168.0.1 255.255.255.255
 isis enable 10

bgp 65520
 router-id 192.168.0.1
 peer 192.168.0.2 as-number 65520
 peer 192.168.0.2 connect-interface LoopBack0
 peer 192.168.0.2 password simple zjdx
 ipv4-family unicast
  undo synchronization
  default-route imported
  import-route direct
  import-route static
  peer 192.168.0.2 enable

ip route-static 0.0.0.0 0.0.0.0 Dialer0

AR2(分部出口)

[AR2]纯净可粘贴 · system-view 起步
system-view
sysname AR2

isis 10
 is-level level-2
 cost-style wide
 network-entity 49.1921.6800.1200.0002.00

interface GigabitEthernet0/0/1
 ip address 192.168.12.2 255.255.255.0
 isis enable 10
 isis circuit-type p2p
 isis authentication-mode md5 plain zjdx

interface GigabitEthernet0/0/2.300
 dot1q termination vid 300
 ip address 192.168.30.1 255.255.255.0
 arp broadcast enable

interface LoopBack0
 ip address 192.168.0.2 255.255.255.255
 isis enable 10

bgp 65520
 router-id 192.168.0.2
 peer 192.168.0.1 as-number 65520
 peer 192.168.0.1 connect-interface LoopBack0
 peer 192.168.0.1 password simple zjdx
 ipv4-family unicast
  undo synchronization
  network 192.168.30.0
  peer 192.168.0.1 enable

LSW1(总部交换)

[LSW1]纯净可粘贴 · system-view 起步
system-view
sysname LSW1

vlan batch 100 200

interface GigabitEthernet0/0/1
 port link-type trunk
 port trunk allow-pass vlan 100

interface GigabitEthernet0/0/2
 port link-type access
 port default vlan 100

interface GigabitEthernet0/0/3
 port link-type access
 port default vlan 200

interface GigabitEthernet0/0/4
 eth-trunk 10

interface GigabitEthernet0/0/5
 eth-trunk 10

interface Eth-Trunk10
 port link-type trunk
 port trunk allow-pass vlan 200
 mode lacp-static

LSW2(分部交换)

[LSW2]纯净可粘贴 · system-view 起步
system-view
sysname LSW2

vlan batch 200 300

interface GigabitEthernet0/0/1
 port link-type trunk
 port trunk allow-pass vlan 300

interface GigabitEthernet0/0/2
 port link-type access
 port default vlan 200

interface GigabitEthernet0/0/3
 port link-type access
 port default vlan 300

interface GigabitEthernet0/0/4
 eth-trunk 10

interface GigabitEthernet0/0/5
 eth-trunk 10

interface Eth-Trunk10
 port link-type trunk
 port trunk allow-pass vlan 200
 mode lacp-static

2.6 预期结果与验证

测试预期
AR1 display pppoe-client session summary会话 Up,获得 200.1.1.x 地址
AR1 display ip interface brief Dialer0有协商到的地址,协议 Up
AR1 display isis peer / AR2 同邻居 Up,Level-2
AR1/AR2 display bgp peer192.168.0.x Established,AS 65520
AR2 display bgp routing-table收到 0.0.0.0/0(由 AR1 default-route imported 引入)
PC2 ping PC3通(VLAN200 跨交换机二层,经 Eth-Trunk)
PC1 ping 8.8.8.8通(AR1 NAT)
PC4 ping 8.8.8.8通(AR2 → 默认路由 → AR1 → NAT)
排错提示:若 AR2 收不到默认路由,检查 AR1 是否 default-route imported + import-route static 同时存在;也可在 AR2 上直接加 ip route-static 0.0.0.0 0 192.168.12.1 兜底。

第三部分 L3实操:VRRP + OSPF + EBGPLAB 3 · 含 IPv6 双栈

网关冗余与跨 AS 互通的综合实验:VRRP 主备网关、Eth-Trunk、OSPF 引入直连、三 AS EBGP 互联,全程 IPv4/IPv6 双栈。

3.1 拓扑

10.1.23.0/2410.1.35.0/24VLAN100 · 10.1.100.0/24VLAN20/200 · 10.1.200.0/24Eth-Trunk10VLAN10 · VIP 10.1.1.1192.168.1.0/24192.168.2.0/24GE0/0/0GE0/0/0GE0/0/2GE0/0/0GE0/0/3GE0/0/1GE0/0/1GE0/0/1Eth0/0/1GE0/0/1Eth0/0/2GE0/0/2Eth0/0/21Eth0/0/21Eth0/0/22Eth0/0/22GE0/0/24Eth0/0/0Eth0/0/1Eth0/0/0Ethernet0/0/0Eth0/0/0R3AS200 运营商R2AS100 出口R5AS300 分支LSW1VRRP 主LSW2VRRP 备LSW3接入层PC1PC2PC3
实验三拓扑 SW1/SW2 双网关(VRRP vrid 10)经 VLAN100/200 单臂上联 R2,R2—R3—R5 三 AS EBGP 互联,R5 下挂远端分支 PC3(还原自 eNSP 工程包 L3实操拓朴.topo)

3.2 地址规划

网段用途分配
10.1.1.0/29VLAN10 终端段(VRRP)VIP 10.1.1.1;SW1 .2;SW2 .3;PC1 .5
192.168.1.0/24VLAN20 终端段R2 GE0/0/1.20 = .1;PC2 = .2
192.168.2.0/24远端分支R5 Eth0/0/0 = .1;PC3 = .2
10.1.100.0/24VLAN100:SW1 ↔ R2SW1 Vlanif100 = .100;R2 GE0/0/3.100 = .2
10.1.200.0/24VLAN200:SW2 ↔ R2SW2 Vlanif200 = .200;R2 GE0/0/1.200 = .2
10.1.23.0/24R2 ↔ R3.2 / .3
10.1.35.0/24R3 ↔ R5.3 / .5
240E:1C:D111:1121::/127R2 ↔ R3(IPv6)R2 ::3,R3 ::2
240E:1C:D111:1122::/127R3 ↔ R5(IPv6)R3 ::2,R5 ::3
240E:690:A201:10::/126PC2 网段(IPv6)R2 ::1,PC2 ::2
240E:690:A202:10::/126PC3 网段(IPv6)R5 ::1,PC3 ::2

3.3 题目要求

  1. VLAN:SW1 建 10/100,SW2 建 10/20/200,SW3 建 10;终端 Access、互联 Trunk;
  2. Eth-Trunk10:SW1-SW2 用 Eth0/0/21、22 做 LACP 静态聚合;
  3. VRRP:vrid 10、VIP 10.1.1.1,SW1 优先级 145 主 / SW2 默认 100 备;
  4. OSPF:SW1 经 VLAN100、SW2 经 VLAN200 与 R2 建邻,area 0,import-route direct;
  5. 单臂路由:R2 建 .20/.200/.100 三个 dot1q 子接口;
  6. EBGP:AS100(R2)↔ AS200(R3)↔ AS300(R5),R2 宣告 192.168.1.0/24、R5 宣告 192.168.2.0/24;
  7. IPv6 双栈:互联 /127、终端 /126、BGP 宣告 /64,ipv6-family unicast 建邻。

3.4 改动清单

设备改动原因
R2BGP 增加 network 10.1.1.0 255.255.255.248原配置没把 VRRP 网段传给 AS200/AS300,PC1 到 PC3 完全不通
SW1增加 stp root primary原拓扑 SW1-SW3-SW2 成环且全默认优先级,SW3 阻塞端口随机,可能绕经 Eth-Trunk
SW1增加 vrrp vrid 10 track interface GigabitEthernet0/0/1 reduced 60原配置无跟踪:SW1 上联断但仍为 Master,PC1 流量被黑洞
SW2增加 stp root secondary与 SW1 配合形成确定的 STP 拓扑
SW2增加 vrrp vrid 10 track interface GigabitEthernet0/0/1 reduced 60同上
SW2删除 port-group trunfka练习残留的空端口组
SW1/R3修正 description 笔误SW1 写成 R2 GE0/0/2(实为 GE0/0/3);R3 多一个 ]

3.5 完整配置

R2(企业出口,AS100)

[R2]纯净可粘贴 · system-view 起步
system-view
sysname R2
ipv6

interface GigabitEthernet0/0/0
 description Link-To-R3-GE0/0/0
 ip address 10.1.23.2 255.255.255.0
 ipv6 enable
 ipv6 address 240E:1C:D111:1121::3/127

interface GigabitEthernet0/0/1.20
 description PC2
 dot1q termination vid 20
 ip address 192.168.1.1 255.255.255.0
 ipv6 enable
 ipv6 address 240E:690:A201:10::1/126
 arp broadcast enable

interface GigabitEthernet0/0/1.200
 dot1q termination vid 200
 ip address 10.1.200.2 255.255.255.0
 arp broadcast enable

interface GigabitEthernet0/0/3.100
 dot1q termination vid 100
 ip address 10.1.100.2 255.255.255.0
 arp broadcast enable

interface LoopBack0
 ip address 10.1.0.2 255.255.255.255

ospf 1
 import-route direct
 area 0.0.0.0
  network 10.1.100.0 0.0.0.255
  network 10.1.200.0 0.0.0.255

bgp 100
 peer 10.1.23.3 as-number 200
 peer 240E:1C:D111:1121::2 as-number 200
 ipv4-family unicast
  undo synchronization
  network 192.168.1.0
  network 10.1.1.0 255.255.255.248
  peer 10.1.23.3 enable
 ipv6-family unicast
  undo synchronization
  network 240E:690:A201:10:: 64
  peer 240E:1C:D111:1121::2 enable

ip route-static 192.168.1.0 255.255.255.0 NULL0
ipv6 route-static 240E:690:A201:10:: 64 NULL0

R3(运营商中转,AS200)

[R3]纯净可粘贴 · system-view 起步
system-view
sysname R3
ipv6

interface GigabitEthernet0/0/0
 description Link-To-R2-GE0/0/0
 ip address 10.1.23.3 255.255.255.0
 ipv6 enable
 ipv6 address 240E:1C:D111:1121::2/127

interface GigabitEthernet0/0/2
 description Link-To-R5-GE0/0/0
 ip address 10.1.35.3 255.255.255.0
 ipv6 enable
 ipv6 address 240E:1C:D111:1122::2/127

interface LoopBack0
 ip address 10.1.0.3 255.255.255.255

bgp 200
 peer 10.1.23.2 as-number 100
 peer 10.1.35.5 as-number 300
 peer 240E:1C:D111:1121::3 as-number 100
 peer 240E:1C:D111:1122::3 as-number 300
 ipv4-family unicast
  undo synchronization
  peer 10.1.23.2 enable
  peer 10.1.35.5 enable
 ipv6-family unicast
  undo synchronization
  peer 240E:1C:D111:1121::3 enable
  peer 240E:1C:D111:1122::3 enable

R5(远端分支,AS300)

[R5]纯净可粘贴 · system-view 起步
system-view
sysname R5
ipv6

interface Ethernet0/0/0
 description Link-To-PC3
 ip address 192.168.2.1 255.255.255.0
 ipv6 enable
 ipv6 address 240E:690:A202:10::1/126

interface GigabitEthernet0/0/0
 description Link-To-R3-GE0/0/2
 ip address 10.1.35.5 255.255.255.0
 ipv6 enable
 ipv6 address 240E:1C:D111:1122::3/127

interface LoopBack0
 ip address 10.1.0.5 255.255.255.255

bgp 300
 peer 10.1.35.3 as-number 200
 peer 240E:1C:D111:1122::2 as-number 200
 ipv4-family unicast
  undo synchronization
  network 192.168.2.0
  peer 10.1.35.3 enable
 ipv6-family unicast
  undo synchronization
  network 240E:690:A202:10:: 64
  peer 240E:1C:D111:1122::2 enable

ip route-static 192.168.2.0 255.255.255.0 NULL0
ipv6 route-static 240E:690:A202:10:: 64 NULL0

SW1(VRRP 主)

[SW1]纯净可粘贴 · system-view 起步
system-view
sysname SW1

vlan batch 10 100

interface Ethernet0/0/1
 description Link-To-SW3-GE0/0/1
 port link-type trunk
 port trunk allow-pass vlan 10

interface Ethernet0/0/21
 description Link-To-SW2-ETH0/0/21
 eth-trunk 10

interface Ethernet0/0/22
 description Link-To-SW2-ETH0/0/22
 eth-trunk 10

interface Eth-Trunk10
 port link-type trunk
 port trunk allow-pass vlan 10
 mode lacp-static

interface GigabitEthernet0/0/1
 description Link-To-R2-GE0/0/3
 port link-type trunk
 port trunk allow-pass vlan 100

interface Vlanif10
 ip address 10.1.1.2 255.255.255.248
 vrrp vrid 10 virtual-ip 10.1.1.1
 vrrp vrid 10 priority 145
 vrrp vrid 10 track interface GigabitEthernet0/0/1 reduced 60

interface Vlanif100
 ip address 10.1.100.100 255.255.255.0

stp root primary

ospf 1
 import-route direct
 area 0.0.0.0
  network 10.1.100.0 0.0.0.255

SW2(VRRP 备)

[SW2]纯净可粘贴 · system-view 起步
system-view
sysname SW2

vlan batch 10 20 200

interface Ethernet0/0/1
 description Link-To-PC2
 port link-type access
 port default vlan 20

interface Ethernet0/0/2
 description Link-To-SW3-GE0/0/2
 port link-type trunk
 port trunk allow-pass vlan 10

interface Ethernet0/0/21
 description Link-To-SW1-ETH0/0/21
 eth-trunk 10

interface Ethernet0/0/22
 description Link-To-SW1-ETH0/0/22
 eth-trunk 10

interface Eth-Trunk10
 port link-type trunk
 port trunk allow-pass vlan 10
 mode lacp-static

interface GigabitEthernet0/0/1
 description Link-To-R2-GE0/0/1
 port link-type trunk
 port trunk allow-pass vlan 20 200

interface Vlanif10
 ip address 10.1.1.3 255.255.255.248
 vrrp vrid 10 virtual-ip 10.1.1.1
 vrrp vrid 10 track interface GigabitEthernet0/0/1 reduced 60

interface Vlanif200
 ip address 10.1.200.200 255.255.255.0

stp root secondary

ospf 1
 import-route direct
 area 0.0.0.0
  network 10.1.200.0 0.0.0.255

SW3(接入层)

[SW3]纯净可粘贴 · system-view 起步
system-view
sysname SW3

vlan batch 10

interface GigabitEthernet0/0/1
 description Link-To-SW1-ETH0/0/1
 port link-type trunk
 port trunk allow-pass vlan 10

interface GigabitEthernet0/0/2
 description Link-To-SW2-ETH0/0/2
 port link-type trunk
 port trunk allow-pass vlan 10

interface GigabitEthernet0/0/24
 description Link-To-PC1
 port link-type access
 port default vlan 10

3.6 预期结果与验证

检查项命令预期
VRRP 主备[SW1] display vrrpState=Master,Priority=145
VRRP 跟踪[SW1] display vrrp verboseTrack Interface: GE0/0/1,Reduced 60
链路聚合display eth-trunk 102 个成员口 Up,LACP
STP 根桥[SW1] display stp briefCIST Root 指向自己
OSPF 邻居[R2] display ospf peer brief与 10.1.100.100、10.1.200.200 均 Full
BGP 邻居[R2] display bgp peer / display bgp ipv6 peerEstablished
PC1 → PC2ping 192.168.1.2通
PC1 → PC3ping 192.168.2.2通(本次补齐后)
PC2 → PC3 v6ping6 240e:690:a202:10::2通
VRRP 切换关闭 SW1 后继续 pingSW2 升 Master,业务恢复
上行故障断开 SW1 GE0/0/1SW1 优先级降为 85,SW2 接管

附录 A 三题考点对照APPENDIX A

考点mstp1120267月L3L3实操
VLAN + Trunk/Access✅✅✅
Eth-Trunk 链路捆绑—✅ LACP✅ LACP
MSTP 多实例负载分担✅ 双实例——
边缘端口 / BPDU 保护✅——
dot1q 单臂路由✅✅✅
VRRP——✅
IGPOSPFISISOSPF
BGP—iBGP 65520EBGP 三 AS
PPPoE—✅ Client + Server—
NAT✅✅—
IPv6 双栈——✅
静态 NULL0 黑洞——✅

附录 B 三题通用的排错顺序APPENDIX B

  1. 二层先通:display vlan → display port vlan → display eth-trunk → display stp brief;
  2. 三层直连:display ip interface brief 看接口是否 Up/Up,ping 直连对端;
  3. IGP:display ospf peer / display isis peer,邻居不 Full 先查区域/认证/网络类型;
  4. 路由表:display ip routing-table protocol ospf/isis/static,确认目标网段有路由;
  5. BGP:display bgp peer(先看 Established)→ display bgp routing-table(再看有没有路由)→ 检查 network 是否有对应的精确前缀在路由表中;
  6. NAT/PPPoE:display nat session all、display pppoe-client session summary;
  7. 终端:网关、掩码、DNS 三项最容易配错,eNSP 里 PC 的网关填错是最高频问题。

附录 C 易错点提醒APPENDIX C

易错点说明
MSTP 域配置不一致三台交换机的 region-name、revision-level、实例映射必须完全相同,差一个字就分属不同域
stp root primary 与 stp instance X root primary前者只作用于实例 0(CIST),多实例必须写 stp instance 1 root primary
stp bpdu-protection 是全局命令配在系统视图,不是接口视图;接口侧是 stp edged-port enable
VRRP 优先级范围0–255,数值越大越优先;root/primary 那种是 STP 的写法
import-route direct 与 network 混用同一网段可能同时产生区域内和外部路由,区域内优先,功能无碍但不规范
IPv6 的 /64 宣告接口是 /126 时,network ... 64 需要一条 /64 的 NULL0 静态路由兜底,否则宣告不出来
PPPoE 客户端只有 pppoe-client dial-bundle-number 不够,Dialer 口必须有 dialer-group,且全局要有 dialer-rule
ACL 匹配方向NAT 的 ACL 匹配的是内网源地址,配反了表现为"能通但抓不到会话"或完全不通