1、01 STP及优化STP及优化 实验目的: 配置Etherchannel及Tunnk并验证 配置每个VLAN Root选择不同的Swtich 配置Portfast及Uplinkfast 配置RST 配置MST 配置Root Guard及BPDU Guard 配置UDLD实验拓扑图:实验步骤:1. 设置SW1,SW2,SW3主机名分别为Core1,Core2, ED-SW2. 把Core1与Core2间的两条链路绑定成etherchannel2,并设置成Trunk modeCore1:interface range fa0/23 - 24 switchport trunk encapsulati
2、on dot1q switch mode trunk channel-group 2 mode onCreating a port-channel interface Port-channel 2interface Port-channel2 switchport trunk encapsulation dot1q switchport mode trunkCore2:interface range fa0/23 - 24 switchport trunk encapsulation dot1q switch mode trunk channel-group 2 mode onCreating
3、 a port-channel interface Port-channel 2interface Port-channel2 switchport trunk encapsulation dot1q switchport mode trunk3. 验证etherchannel设置Core1#sh etherchannel summary Flags: D - down P - in port-channel I - stand-alone s - suspended H - Hot-standby (LACP only) R - Layer3 S - Layer2 U - in use f
4、- failed to allocate aggregator u - unsuitable for bundling w - waiting to be aggregated d - default portNumber of channel-groups in use: 1Number of aggregators: 1Group Port-channel Protocol Ports-+-+-+-2 Po2(SU) - fa0/23(P) fa0/24(P)4. Core1,Core2,ED-SW间的所有链路均设置成TrunkED-SW:int range f0/23 24no shut
5、downswitchport mode trunkCore1:int f0/21 switch trunk encap dot1q switch mode trunkCore2:int f0/21 switch trunk encap dot1q switch mode trunk5. 验证etherchannel设置Core2#show interface trunk Port Mode Encapsulation Status Native vlanFa0/21 on 802.1q trunking 1Po2 on 802.1q trunking 1Port Vlans allowed o
6、n trunkFa0/21 1-4094Po2 1-4094Port Vlans allowed and active in management domainFa0/21 1 Po2 1Port Vlans in spanning tree forwarding state and not prunedFa0/21 1Po2 16. 添加vlan1-10,奇数vlan生成树根选择Core1,偶数vlan生成树根选择Core2Core1,Core2,ED-SW:vlan 2 name testvlan2vlan 3 name testvlan3vlan 4 name testvlan4vlan
7、 5 name testvlan5vlan 6 name testvlan6vlan 7 name testvlan7vlan 8 name testvlan8vlan 9 name testvlan9vlan 10 name testvlan107. 验证新添加的vlanCore1#sh vlan brief VLAN Name Status Ports- -1 default active Fa0/1, Fa0/2, Fa0/3, Fa0/4 Fa0/5, Fa0/6, Fa0/7, Fa0/8 Fa0/9, Fa0/10, Fa0/11, Fa0/12 Fa0/13, Fa0/14, F
8、a0/15, Fa0/16 Fa0/17, Fa0/18, Fa0/19, Fa0/20 Fa0/22, Gi0/1, Gi0/22 testvlan2 active 部分输出忽略 9 testvlan9 active 10 testvlan10 active 1002 fddi-default act/unsup 1003 token-ring-default act/unsup 8. 验证新添加的vlanCore1#sh spanning-tree VLAN0001 Spanning tree enabled protocol ieee Root ID Priority 32769 Add
9、ress 000d.65dc.8800 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 000d.65dc.8800 Hello Time 2 sec Max Age 20 sec Forward Delay 15 sec Aging Time 300Interface Role Sts Cost Prio.Nbr Type- - - - - -Fa0/4 Desg
10、 FWD 19 128.4 P2p Fa0/21 Desg FWD 19 128.21 P2p Po2 Desg FWD 12 128.65 P2p VLAN0002 Spanning tree enabled protocol ieee Root ID Priority 32770 Address 000d.65dc.8800 This bridge is the root Hello Time 2 sec Max Age 20 sec Forward Delay 15 sec Bridge ID Priority 32770 (priority 32768 sys-id-ext 2) Ad
11、dress 000d.65dc.8800 Hello Time 2 sec Max Age 20 sec Forward Delay 15 sec Aging Time 300 Interface Role Sts Cost Prio.Nbr Type- - - - - -Fa0/21 Desg FWD 19 128.21 P2p Po2 Desg FWD 12 128.65 P2p9. 设置Core1为vlan 1,3,5,7,9的主根作为vlan2,4,6,8,10的次根设置Core2为vlan2,4,6,8,10的主根作为vlan1,3,5,7,9的次根Core1:spanning-tr
12、ee vlan 1,3,5,7,9 root primaryspanning-tree vlan 2,4,6,8,10 root secondaryCore2:spanning-tree vlan 1,3,5,7,9 root secondaryspanning-tree vlan 2,4,6,8,10 root primary10. 验证根配置Core1#sh spanning-tree VLAN0001 Spanning tree enabled protocol ieee Root ID Priority 24577 Address 000d.65dc.8800 This bridge
13、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 000d.65dc.8800 Hello Time 2 sec Max Age 20 sec Forward Delay 15 sec Aging Time 300Interface Role Sts Cost Prio.Nbr Type- - - - - -Fa0/4 Desg FWD 19 128.4 P2p Fa0/21 Desg FW
14、D 19 128.21 P2p Po2 Desg FWD 12 128.65 P2p VLAN0002 Spanning tree enabled protocol ieee Root ID Priority 24578 Address 0013.80e2.4880 Cost 12 Port 65 (Port-channel2) Hello Time 2 sec Max Age 20 sec Forward Delay 15 sec Bridge ID Priority 28674 (priority 28672 sys-id-ext 2) Address 000d.65dc.8800 Hel
15、lo Time 2 sec Max Age 20 sec Forward Delay 15 sec Aging Time 300Interface Role Sts Cost Prio.Nbr Type- - - - - -Fa0/21 Desg FWD 19 128.21 P2p Po2 Root FWD 12 128.65 P2pCore1#sh runspanning-tree mode pvstspanning-tree vlan 1,3,5,9 priority 24576spanning-tree vlan 2,4,6,8,10 priority 2867211. 把PC接入到ED
16、-SW的Fa0/2,并记录端口指示灯转换到绿色的时间_S为了解决交换机端口转发延迟问题,启用Fa0/2的portfast功能ED-SW:ed-sw(config-if)#spanning-tree portfast %Warning: portfast should only be enabled on ports connected to a single host. Connecting hubs, concentrators, switches, bridges, etc. to this interface when portfast is enabled, can cause tem
17、porary bridging loops. Use with CAUTION%Portfast has been configured on FastEthernet0/2 but will only have effect when the interface is in a non-trunking mode.注:也可以在全局模式下输入spanning-tree portfast default启用所有的端口portfast功能12. 重新插拔PC与ED-SW的网线,再次记录端口指示灯转换到绿色的时间_S验证portfast已经在Fa0/2口上启用ed-sw#sh spanning-tr
18、ee interface f0/2 portfast VLAN0001 enabled13. 配置PC IP地址:192.168.88.203/24配置Core1 Vlan1 IP地址:192.168.88.201/24配置Core2 Vlan1 IP地址:192.168.88.202/24Core1:interface Vlan1 ip address 192.168.88.201 255.255.255.0 no shutendCore2:interface Vlan1 ip address 192.168.88.202 255.255.255.0 no shutend14. 在PC的DO
19、S命令行下: ping 192.168.88.201 -t断掉ED-SW到Core1的连接,记录ping包丢失了_个15. 在ED-SW上配置uplinkfasted-sw(config)#spanning-tree uplinkfast16. 验证uplinkfasted-sw#sh spanning-tree uplinkfast UplinkFast is enabled17. 在PC的DOS命令行下: ping 192.168.88.201 -t断掉ED-SW到Core1的连接,记录ping包丢失了_个18. 取消ED-SW的uplinkfast功能ed-sw(config)#no s
20、panning-tree uplinkfast 19. 启用Core1,Core2,ED-SW的RSTP功能Core1,Core2,ED-SW:(Config)#spanning-tree mode rapid-pvst20. 验证RSTP是否启用ed-sw#sh spanning-tree VLAN0001 Spanning tree enabled protocol rstp Root ID Priority 24577 Address 000d.65dc.8800 Cost 19 Port 23 (FastEthernet0/23) Hello Time 2 sec Max Age 20
21、 sec Forward Delay 15 sec Bridge ID Priority 32769 (priority 32768 sys-id-ext 1) Address 000d.bdbb.7480 Hello Time 2 sec Max Age 20 sec Forward Delay 15 sec Aging Time 300Interface Role Sts Cost Prio.Nbr Type- - - - - -Fa0/2 Desg FWD 19 128.2 Edge P2p Fa0/4 Desg BLK 19 128.4 P2p Fa0/23 Root FWD 19 1
22、28.23 P2p Fa0/24 Altn BLK 19 128.24 P2p VLAN0002 Spanning tree enabled protocol rstp Root ID Priority 24578 Address 0013.80e2.4880 Cost 19 Port 24 (FastEthernet0/24) Hello Time 2 sec Max Age 20 sec Forward Delay 15 sec Bridge ID Priority 32770 (priority 32768 sys-id-ext 2) Address 000d.bdbb.7480 Hel
23、lo Time 2 sec Max Age 20 sec Forward Delay 15 sec Aging Time 300Interface Role Sts Cost Prio.Nbr Type- - - - - -Fa0/23 Altn BLK 19 128.23 P2p Fa0/24 Root FWD 19 128.24 P2p在PC的DOS命令行下:ping 192.168.88.201 -t断掉ED-SW到Core1的连接,记录ping包丢失了_个21. 配置MSTCore1,Core2,ED-SW上启用两个MST Instance 1,2Vlan1,3,5,7,9映射到Ins
24、tance 1Vlan2,4,6,8,10映射到Instance 2Core1 instance 1优先级设为 4096 Instacen 2优先级设置 16384Core2 instance 1优先级设为 16384 Instacen 2优先级设置 4096Core1:spanning-tree mode mstspanning-tree mst configuration instance 1 vlan 1, 3, 5, 7, 9 instance 2 vlan 2, 4, 6, 8, 10spanning-tree mst 1 priority 16384spanning-tree ms
25、t 2 priority 8192Core2:spanning-tree mode mstspanning-tree mst configuration instance 1 vlan 1, 3, 5, 7, 9 instance 2 vlan 2, 4, 6, 8, 10spanning-tree mst 1 priority 16384spanning-tree mst 2 priority 8192ED-SW:spanning-tree mode mstspanning-tree mst configuration instance 1 vlan 1, 3, 5, 7, 9 instan
26、ce 2 vlan 2, 4, 6, 8, 1022. 验证MST配置Core2#sh spanning-tree MST0 Spanning tree enabled protocol mstp Root ID Priority 32768 Address 000d.65dc.8800 Cost 0 Port 65 (Port-channel2) Hello Time 2 sec Max Age 20 sec Forward Delay 15 sec Bridge ID Priority 32768 (priority 32768 sys-id-ext 0) Address 0013.80e
27、2.4880 Hello Time 2 sec Max Age 20 sec Forward Delay 15 secInterface Role Sts Cost Prio.Nbr Type- - - - - -Fa0/4 Desg FWD 200000 128.4 P2p Fa0/21 Desg FWD 200000 128.21 P2p Pre-STD-Rx Po2 Root FWD 100000 128.65 P2p MST1 Spanning tree enabled protocol mstp Root ID Priority 16385 Address 0013.80e2.488
28、0 This bridge is the root Hello Time 2 sec Max Age 20 sec Forward Delay 15 sec Bridge ID Priority 16385 (priority 16384 sys-id-ext 1) Address 0013.80e2.4880 Hello Time 2 sec Max Age 20 sec Forward Delay 15 sec Interface Role Sts Cost Prio.Nbr Type- - - - - -Fa0/4 Desg FWD 200000 128.4 P2p Fa0/21 Desg FWD 200000 128.21 P2p Pre-STD-Rx Po2 Desg FWD 100000 128.65 P2p MST2 Spanning tree enabled protocol mstp Root ID Priority 8194 Address 0013.80e2.4
copyright@ 2008-2022 冰豆网网站版权所有
经营许可证编号:鄂ICP备2022015515号-1