2024年年11月案例分析T1

公司为某科技园区的不同企业提供网络服务,不同企业的业务有所不同,每个企业因业务需要在不同的地点有多个分支结构。其拓扑结构如图所示。企业用户通过楼层接入交换机,楼栋汇聚交换机和区域交换机接入汇聚层网络。

设备 名称 业务 所属vlan
H1,H2 楼层接入交换机 企业1 vlan10
企业2 vlan20
企业3 vlan30
P1,P2 楼栋汇聚交换机 企业1 vlan100
企业2 vlan100
企业3 vlan200
C1 区域交换机 企业1 vlan300
企业2 vlan300
企业3 vlan300
# 问题1
# 按照上表的部署配置楼层接入交换机上的VLAN(下列命令是思科网络模拟器的命令,实际情况下,考试用的是华为的命令)

H1>enable
H1#config terminal
Enter configuration commands, one per line. End with CNTL/Z.
H1(config)#vlan 10
H1(config-vlan)#vlan 20
H1(config-vlan)#vlan 30
H1(config-vlan)#exit
H1(config)#interface f 0/1
H1(config-if)#switchport mode access
H1(config-if)#switchport access vlan 10
H1(config-if)#exit
H1(config)#interface f 0/2
H1(config-if)#switchport mode access
H1(config-if)#switchport access vlan 20
H1(config-if)#exit
H1(config)#interface f 0/3
H1(config-if)#switchport mode access
H1(config-if)#switchport access vlan 30
H1(config-if)#exit
H1#show vlan

VLAN Name Status Ports
---- -------------------------------- --------- -------------------------------
1 default active Fa0/5, Fa0/6, Fa0/7, Fa0/8
Fa0/9, Fa0/10, Fa0/11, Fa0/12
Fa0/13, Fa0/14, Fa0/15, Fa0/16
Fa0/17, Fa0/18, Fa0/19, Fa0/20
Fa0/21, Fa0/22, Fa0/23, Fa0/24
Gig1/1, Gig1/2
10 VLAN0010 active Fa0/1
20 VLAN0020 active Fa0/2
30 VLAN0030 active Fa0/3
1002 fddi-default act/unsup
1003 token-ring-default act/unsup
1004 fddinet-default act/unsup
1005 trnet-default act/unsup

VLAN Type SAID MTU Parent RingNo BridgeNo Stp BrdgMode Trans1 Trans2
---- ----- ---------- ----- ------ ------ -------- ---- -------- ------ ------
1 enet 100001 1500 - - - - - 0 0
10 enet 100010 1500 - - - - - 0 0
20 enet 100020 1500 - - - - - 0 0
30 enet 100030 1500 - - - - - 0 0
1002 fddi 101002 1500 - - - - - 0 0
1003 tr 101003 1500 - - - - - 0 0
1004 fdnet 101004 1500 - - - ieee - 0 0
1005 trnet 101005 1500 - - - ibm - 0 0

Remote SPAN VLANs
------------------------------------------------------------------------------


Primary Secondary Type Ports
------- --------- ----------------- ------------------------------------------
H1#config terminal
Enter configuration commands, one per line. End with CNTL/Z.
H1(config)#interface f 0/4
H1(config-if)#switchport mode trunk
H1(config-if)#no shutdown
H1(config-if)#exit
# 问题1
# 按照上表的部署配置楼层接入交换机上的VLAN

<H1>system-view
Enter system view, return user view with return command.
[~H1]sysname H1
<H1>save
Warning: The current configuration will be written to the device. Continue? [Y/N
]:y
Now saving the current configuration to the slot 1
Info: Save the configuration successfully.
<H1>system-view
Enter system view, return user view with return command.
[~H1]vlan batch 10 20 30
[*H1]interface GE 1/0/0
[*H1-GE1/0/0]port link-type access
[*H1-GE1/0/0]port default vlan 10
[*H1-GE1/0/0]quit
[*H1]interface GE 1/0/3
[*H1-GE1/0/3]port link-type trunk
[*H1-GE1/0/3]port trunk allow-pass vlan 10 20 30
[*H1-GE1/0/3]quit
[*H1]interface GE 1/0/1
[*H1-GE1/0/1]port link-type access
[*H1-GE1/0/1]port default vlan 20
[*H1-GE1/0/1]quit
[*H1]interface GE 1/0/2
[*H1-GE1/0/2]port link-type access
[*H1-GE1/0/2]port default vlan 30
[*H1-GE1/0/2]quit
<H1>save
Warning: The current configuration will be written to the device. Continue? [Y/N
]:y
Now saving the current configuration to the slot 1
Info: Save the configuration successfully.
<H1>display vlan
The total number of vlans is : 4
--------------------------------------------------------------------------------
U: Up; D: Down; TG: Tagged; UT: Untagged;
MP: Vlan-mapping; ST: Vlan-stacking;
#: ProtocolTransparent-vlan; *: Management-vlan;
MAC-LRN: MAC-address learning; STAT: Statistic;
BC: Broadcast; MC: Multicast; UC: Unknown-unicast;
FWD: Forward; DSD: Discard;
--------------------------------------------------------------------------------

VID Ports
--------------------------------------------------------------------------------
1 UT:GE1/0/3(D) GE1/0/4(D) GE1/0/5(D) GE1/0/6(D)
GE1/0/7(D) GE1/0/8(D) GE1/0/9(D) GE1/0/10(D)
GE1/0/11(D) GE1/0/12(D) GE1/0/13(D) GE1/0/14(D)
GE1/0/15(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) GE1/0/29(D) GE1/0/30(D)
GE1/0/31(D) GE1/0/32(D) GE1/0/33(D) GE1/0/34(D)
GE1/0/35(D) GE1/0/36(D) GE1/0/37(D) GE1/0/38(D)
GE1/0/39(D) GE1/0/40(D) GE1/0/41(D) GE1/0/42(D)
GE1/0/43(D) GE1/0/44(D) GE1/0/45(D) GE1/0/46(D)
GE1/0/47(D)
10 UT:GE1/0/0(D)
TG:GE1/0/3(D)
20 UT:GE1/0/1(D)
TG:GE1/0/3(D)
30 UT:GE1/0/2(D)
TG:GE1/0/3(D)

VID Type Status Property MAC-LRN STAT BC MC UC Description
--------------------------------------------------------------------------------
1 common enable default enable disable FWD FWD FWD VLAN 0001
10 common enable default enable disable FWD FWD FWD VLAN 0010
20 common enable default enable disable FWD FWD FWD VLAN 0020
30 common enable default enable disable FWD FWD FWD VLAN 0030
# 问题二
# 在楼层接入交换机上,同一企业处于相同的vlan中。公司为了节省VLAN资源,在楼栋汇聚交换机上采用QinQ技术,使得相同企业的业务实现透传

[Huawei]vlan batch 100 200
[Huawei]sysname P1
[P1]interface G 0/0/1
[P1-GigabitEthernet0/0/1]port link-type trunk
[P1-GigabitEthernet0/0/1]port trunk allow-pass vlan 100 200
[P1-GigabitEthernet0/0/1]qinq vlan-translation enable
[P1-GigabitEthernet0/0/1]port vlan-stacking vlan 10 stack-vlan 100
[P1-GigabitEthernet0/0/1]port vlan-stacking vlan 20 stack-vlan 100
[P1-GigabitEthernet0/0/1]port vlan-stacking vlan 30 stack-vlan 200
[P1-GigabitEthernet0/0/1]quit
<P1>save
The current configuration will be written to the device.
Are you sure to continue?[Y/N]y
Info: Please input the file name ( *.cfg, *.zip ) [vrpcfg.zip]:
May 27 2025 09:28:19-08:00 P1 %%01CFM/4/SAVE(l)[0]:The user chose Y when decidin
g whether to save the configuration to the device.
Now saving the current configuration to the slot 0.
Save the configuration successfully.
# 问题三
# 在区域交换机上配置VLAN Mapping技术,使得相同企业的业务在不同层次中的vlan可以互通

[C1]interface G 0/0/3
[C1-GigabitEthernet0/0/3]port vlan-mapping vlan 100 inner-vlan 10 to 20 map-vlan 300
[C1-GigabitEthernet0/0/3]port vlan-mapping vlan 200 inner-vlan 30 map-vlan
300
[C1-GigabitEthernet0/0/3]quit

华为文档中关于vlan mapping的部分