感谢关注WOLFLAB实验室,我们定期都会更新关于CCNP相关技术文档
讲师:WOLFLAB杨广成
CCIE#-RS、SP、Security、DC
HCIE#-RS
交换分解实验二(答案与解析)
需求描述
- 实验室交换机架登陆:
Rack 99 192.168.9.99
Rack 98 192.168.9.98
Rack 100 192.168.9.100
做实验之前,请重启设备,做完实验后,请勿保存。想要通过外网登陆机架请联系WOLFLAB,获取登陆方式。
- 在sw1 sw2 sw3上创建vlan 2,3,show spanning-tree,查看Root信息。
SW1: SW1#show spanning-tree VLAN0001 Spanning tree enabled protocol ieee Root ID Priority 32769 Address 000b.5f01.4380 This bridge is the root Hello Time 2 sec Max Age 20 sec Forward Delay 15 sec Bridge ID Priority 32769 (priority 32768 sys-id-ext 1) Address 000b.5f01.4380 Hello Time 2 sec Max Age 20 sec Forward Delay 15 sec Aging Time 15 Interface Role Sts Cost Prio.Nbr Type ---------------- ---- --- --------- -------- -------------------------------- Fa0/1 Desg FWD 100 128.1 Shr Fa0/2 Desg FWD 100 128.2 Shr Fa0/11 Desg FWD 19 128.11 P2p Fa0/12 Desg FWD 19 128.12 P2p Fa0/13 Desg FWD 19 128.13 P2p 解析:此时可以看到sw1是vlan1,2,3的Root。默认情况下,交换运行的是PVST,选Root首先比较priority,小的优先(默认都是32768),然后比较交换机的基mac地址。sw1的基mac地址比较小,所以sw1称为Root。 |
- 配置sw1的priority为28672,在sw1观察Root的信息。
SW1: spanning-tree vlan 1 priority 28672 SW1#show spanning-tree vlan 1 VLAN0001 Spanning tree enabled protocol ieee Root ID Priority 28673 Address 000f.24aa.5400 This bridge is the root Hello Time 2 sec Max Age 20 sec Forward Delay 15 sec Bridge ID Priority 28673 (priority 28672 sys-id-ext 1) Address 000f.24aa.5400 Hello Time 2 sec Max Age 20 sec Forward Delay 15 sec Aging Time 15 解析:配置priority的时候,需要是4096的倍数。 |
- 配置sw2为vlan 1的Root Primary,show spanning-tree vlan 1 查看Root情况。
SW2: spanning-tree vlan 1 root primary SW2#show spanning-tree vlan 1 VLAN0001 Spanning tree enabled protocol ieee Root ID Priority 24577 Address 000b.5f01.4380 This bridge is the root Hello Time 2 sec Max Age 20 sec Forward Delay 15 sec Bridge ID Priority 24577 (priority 24576 sys-id-ext 1) Address 000b.5f01.4380 Hello Time 2 sec Max Age 20 sec Forward Delay 15 sec Aging Time 15 解析:此时可以看到sw2是vlan1的Root。Root primary的规则:
|
- 配置sw1为vlan 2的Root Secondary,配置sw2为vlan 2的Root Primary,在sw1和sw2上show spanning-tree vlan 2 查看Root情况。
SW1: spanning-tree vlan 2 root secondary |
SW2: spanning-tree vlan 2 root primary |
SW1#show spanning-tree vlan 2 VLAN0002 Spanning tree enabled protocol ieee Root ID Priority 24578 Address 000f.24aa.5400 Cost 19 Port 11 (FastEthernet0/11) Hello Time 2 sec Max Age 20 sec Forward Delay 15 sec Bridge ID Priority 28674 (priority 28672 sys-id-ext 2) Address 000b.5f01.4380 Hello Time 2 sec Max Age 20 sec Forward Delay 15 sec SW2#show spanning-tree vlan 2 VLAN0002 Spanning tree enabled protocol ieee Root ID Priority 24578 Address 000f.24aa.5400 This bridge is the root Hello Time 2 sec Max Age 20 sec Forward Delay 15 sec Bridge ID Priority 24578 (priority 24576 sys-id-ext 2) Address 000f.24aa.5400 Hello Time 2 sec Max Age 20 sec Forward Delay 15 sec Aging Time 300 解析:此时可以看到sw2是vlan2的Root,priority为24576,sw1上priority为28672。Root secondary的priority是固定的28672。网络中若是配置Root primary与Root secondary,前提是priority是默认的32768才有意义。 |
- 针对vlan 1,配置sw3的F0/23接口的cost为38,sw3上哪个端口是RP?
SW3: interface FastEthernet0/23 spanning-tree vlan 1 cost 38 SW3#show spanning-tree vlan 1 VLAN0001 Spanning tree enabled protocol ieee Root ID Priority 24577 Address 000f.24aa.5400 Cost 38 Port 23 (FastEthernet0/23) Hello Time 2 sec Max Age 20 sec Forward Delay 15 sec Bridge ID Priority 32769 (priority 32768 sys-id-ext 1) Address 000c.8577.3240 Hello Time 2 sec Max Age 20 sec Forward Delay 15 sec Aging Time 15 Interface Role Sts Cost Prio.Nbr Type ---------------- ---- --- --------- -------- -------------------------------- Fa0/13 Altn BLK 19 128.13 P2p Fa0/23 Root FWD 38 128.23 P2p |
- 针对vlan 1,配置sw2的F0/12接口的port priority为112,sw1上哪个端口是RP?
SW2: interface FastEthernet0/12 spanning-tree vlan 1 port-priority 112 |
SW1#show spanning-tree vlan 1 VLAN0001 Spanning tree enabled protocol ieee Root ID Priority 24577 Address 000f.24aa.5400 Cost 19 Port 12 (FastEthernet0/12) Hello Time 2 sec Max Age 20 sec Forward Delay 15 sec Bridge ID Priority 28673 (priority 28672 sys-id-ext 1) Address 000b.5f01.4380 Hello Time 2 sec Max Age 20 sec Forward Delay 15 sec Aging Time 15 Interface Role Sts Cost Prio.Nbr Type ---------------- ---- --- --------- -------- -------------------------------- Fa0/1 Desg FWD 100 128.1 Shr Fa0/2 Desg FWD 100 128.2 Shr Fa0/11 Altn BLK 19 128.11 P2p Fa0/12 Root FWD 19 128.12 P2p Fa0/13 Desg FWD 19 128.13 P2p |
- 在sw1 sw2 sw3上,show spanning-tree vlan 1 观察哪些端口是DP,哪些端口Block,通过现象思考STP选路。
SW1#show spanning-tree vlan 1 VLAN0001 Interface Role Sts Cost Prio.Nbr Type ---------------- ---- --- --------- -------- -------------------------------- Fa0/1 Desg FWD 100 128.1 Shr Fa0/2 Desg FWD 100 128.2 Shr Fa0/11 Altn BLK 19 128.11 P2p Fa0/12 Root FWD 19 128.12 P2p Fa0/13 Desg FWD 19 128.13 P2p |
SW2#show spanning-tree vlan 1 VLAN0001 Spanning tree enabled protocol ieee Root ID Priority 24577 Address 000f.24aa.5400 This bridge is the root Hello Time 2 sec Max Age 20 sec Forward Delay 15 sec Interface Role Sts Cost Prio.Nbr Type ---------------- ---- --- --------- -------- -------------------------------- Fa0/1 Desg FWD 100 128.1 Shr Fa0/2 Desg FWD 100 128.2 Shr Fa0/11 Desg FWD 19 128.11 P2p Fa0/12 Desg FWD 19 112.12 P2p Fa0/23 Desg FWD 19 128.23 P2p |
SW3#show spanning-tree vlan 1 VLAN0001 Interface Role Sts Cost Prio.Nbr Type ---------------- ---- --- --------- -------- -------------------------------- Fa0/13 Altn BLK 19 128.13 P2p Fa0/23 Root FWD 38 128.23 P2p |
- 如下图,图中交换机的priority为默认值32768:
交换机基mac:上面的小,右边的大;左边的小,右边的大
交换机port-id:上面的小,右边的大;左边的小,右边的大
分析图中哪些接口会被Block掉。
感谢关注WOLFLAB网络实验室,我们定期都会更新关于CCNP相关技术文档!