一、配置项目拓扑图
STP的全称是spanning-tree protocol,STP协议是一个二层的链路管理协议,它在提供链路冗余的同时防止网络产生环路,与VLAN配合可以提供链路负载均衡。生成树协议现已经发展为多生成树协议(MSTP)和快速生成树协议(RSTP),如图8-4所示。
两台Cisco 2960交换机使用两个千兆端口相连,默认情况下STP协议是启用的。通过两台交换机之间传送BPDU协议数据单元,选出根交换机、根端口等,以便确定端口的转发状态。上图中标记为黄色的端口处于block状态。
二、STP基本配置命令
(一)Switch3修改Brigde ID,重新选根网桥
Switch3(config)#spanning-tree vlan 1 priority 4096 !修改Brigde ID为4096
Switch#show spanning-tree
VLAN0001
Spanning tree enabled protocol ieee
Root ID Priority 4097
Address 0001.644A.3DD1
This bridge is the root
Hello Time 2 sec Max Age 20 sec Forward Delay 15 sec
Bridge ID Priority 4097 (priority 4096 sys-id-ext 1)
Address 0001.644A.3DD1
Hello Time 2 sec Max Age 20 sec Forward Delay 15 sec
P2p
Aging Time 20
Interface Role Sts Cost Prio.Nbr Type
---------------- ---- --- --------- -------- --------------------------------
Fa0/1 Desg FWD 19 128.1 P2p
Fa0/2 Desg FWD 19 128.2 P2p
Fa0/3 Desg FWD 19 128.3 P2p
Fa0/4 Desg FWD 19 128.4 P2p
注意
(二)查看、检验STP(生成树协议)配置
switch#show spanning-tree
switch#show spanning-tree active
switch#show spanning-tree detail
switch#show spanning-tree interface interface-id
switch#show spanning-tree vlan vlanid