WOLFLAB CCNP培训技术文档交换-生成树协议STP的选路演示-超详细

感谢关注WOLFLAB实验室,我们定期都会更新关于CCNP相关技术文档

讲师:WOLFLAB杨广成 
​CCIE#-RS、SP、Security、DC
HCIE#-RS


交换分解实验二(答案与解析)

需求描述

  1. 实验室交换机架登陆:

Rack 99   192.168.9.99      

Rack 98   192.168.9.98

Rack 100  192.168.9.100

做实验之前,请重启设备,做完实验后,请勿保存。想要通过外网登陆机架请联系WOLFLAB,获取登陆方式。

  1. sw1 sw2 sw3上创建vlan 23show 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

解析:此时可以看到sw1vlan123Root。默认情况下,交换运行的是PVST,选Root首先比较priority,小的优先(默认都是32768),然后比较交换机的基mac地址。sw1的基mac地址比较小,所以sw1称为Root

  1. 配置sw1priority28672,在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的倍数。

  1. 配置sw2vlan 1Root Primaryshow 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

解析:此时可以看到sw2vlan1RootRoot primary的规则:

  • 当前跟桥优先级大于或等于32768时,配置root primary将优先级降到24576
  • 当前跟桥优先级小于32768时,如果本交换机的基mac地址小于当前跟桥,配置root primary降优先级与当前跟桥一致;如果基mac地址大于当前跟桥,降再将一级;
  • 当前跟桥优先级如果是4096,配置root primary不会生效,交换机的优先级不能被此命令降至0,除非本交换机的基mac地址小于当前根桥。
  1. 配置sw1vlan 2Root Secondary,配置sw2vlan 2Root Primary,在sw1sw2show 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

解析:此时可以看到sw2vlan2Rootpriority24576sw1priority28672Root secondarypriority是固定的28672。网络中若是配置Root primaryRoot secondary,前提是priority是默认的32768才有意义。

  1. 针对vlan 1,配置sw3F0/23接口的cost38sw3上哪个端口是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

  1. 针对vlan 1,配置sw2F0/12接口的port priority112sw1上哪个端口是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

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

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

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

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

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

感谢关注WOLFLAB网络实验室,我们定期都会更新关于CCNP相关技术文档!

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 打赏
    打赏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包

打赏作者

WOLFLAB实验室

你的鼓励将是我创作的最大动力

¥1 ¥2 ¥4 ¥6 ¥10 ¥20
扫码支付:¥1
获取中
扫码支付

您的余额不足,请更换扫码支付或充值

打赏作者

实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值