WOLF-LAB沃尔夫网络实验室中国网络精英的发源地!
24小时咨询热线:173-1636-2402

技术文档

Technical documentation

您当前位置: 首页 > 技术文档 > 详情

生成树STP协议的选路过程与配置演示-EI CCNP Enterprise Infrastructure技术学习

发布日期:2022-04-05 浏览次数:1940 来源:杨广成

生成树STP协议的选路过程与配置演示-EI CCNP Enterprise Infrastructure技术学习

官方微信同电话:17316362402,

联系WOLF-LAB(沃尔夫)实验室获取免费CCNP培训学习资料视频


1.      在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。

2.      配置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的规则:

①  当前跟桥优先级小于32768时,如果本交换机的基mac地址小于当前跟桥,配置root primary降优先级与当前跟桥一致;如果基mac地址大于当前跟桥,降再将一级;

③      配置sw1为vlan 2的Root Secondary,配置sw2为vlan 2的Root Primary,在sw1和sw2上show spanning-tree vlan 2 查看Root情况。

SW1:spanning-tree vlan 2 root secondarySW2:spanning-tree vlan 2 root primarySW1#show spanning-tree vlan 2VLAN0002  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 2VLAN0002  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才有意义。

5.      针对vlan 1,配置sw2的F0/12接口的port priority为112,sw1上哪个端口是RP?

SW2:interface FastEthernet0/12 spanning-tree vlan 1 port-priority 112SW1#show spanning-tree vlan 1VLAN0001  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    ShrFa0/2            Desg FWD 100       128.2    ShrFa0/11           Altn BLK 19        128.11   P2pFa0/12           Root FWD 19        128.12   P2pFa0/13           Desg FWD 19        128.13   P2p

7.      如下图,图中交换机的priority为默认值32768:

交换机基mac:上面的小,右边的大;左边的小,右边的大

交换机port-id:上面的小,右边的大;左边的小,右边的大

分析图中哪些接口会被Block掉。


联系WOLF-LAB(沃尔夫)实验室获取免费CCNP培训学习资料视频
官方微信同电话:17316362402
官方QQ:2569790740

http://www.wolf-lab.com/

返回目录
在线咨询