STP_根防护

转载自:http://linzhibin824.blog.163.com/blog/static/73557710201112001416130/

Root Guard

guard root能够强制让接口成为designated port,进而能够防止周围的交换机成为root bridge。
当端口启用根防护特性的时候,交换机将不允许端口成为STP root port。端口仍将作为STP designated port。此外,如果端口接收到更优的BPDU,那么guard root将把端口置为err-disable状态。通过禁用端口,网络拓扑将受到保护。
设计建议:在所有的接入端口上启用guard root,进而不会通过这些端口建立root bridge。

现在模拟一个实验:
S1(config)#int ran f0/1 - 2
S1(config-if-range)#sw tr en dot
S1(config-if-range)#sw m t
S1(config-if-range)#int f0/1
S1(config-if)#sw non
S1(config-if)#int f0/2
S1(config-if)#sw non
S1(config-if)#exi
S1(config)#span vlan 1 pri 4096

S2作为一个secondary root:
S2(config)#span vlan 1 pri 8192

现在有个Sx交换机企图接入网络,并且将priority配置为0:
Sx(config)#span vlan 1 pri 0

STP_根防护 - 卡书 - 自主学习

显然,网络中的root bridge会被这台非预期的交换机给抢占!这并不是我们想看到的。并且,Sx交换机把root bridge抢占后,会导致两台核心交换机相连的链路被STP阻塞掉,而Sx的性能如果低下,会导致整个网络性能骤降!

现在,把连接Sx交换的接口shut后,并在S3中的所有接入端口上都启用guard root特性,防止这种意外产生:
S3(config)#int ran f0/4 - 24
S3(config-if-range)#span guard root

再重新打开端口,会看到guard root特性保护了网络中的root bridge,S3交换机的f0/1被置为了root-inconsistent state,f0/1被blocking,因为PT5.3模拟效果不佳,显示结果不完善!如果可以,使用sh span inconsistentports查看哪些接口处于inconsistent state:
%SPANTREE-2-ROOTGUARDBLOCK: Port 0/1 tried to become non-designated in VLAN 1.

Moved to root-inconsistent state

STP_根防护 - 卡书 - 自主学习
S3#sh span sum to
Switch is in pvst mode
Root bridge for:
Extended system ID           is enabled
Portfast Default             is disabled
PortFast BPDU Guard Default  is disabled
Portfast BPDU Filter Default is disabled
Loopguard Default            is disabled
EtherChannel misconfig guard is disabled
UplinkFast                   is disabled
BackboneFast                 is disabled
Configured Pathcost method used is short

Name                   Blocking Listening Learning Forwarding STP Active
---------------------- -------- --------- -------- ---------- ----------
1 vlans                      1         0        0          1          2


S3#sh span
VLAN0001
  Spanning tree enabled protocol ieee
  Root ID    Priority    4097
             Address     00D0.FF6B.DDBC
             Cost        19
             Port        2(FastEthernet0/2)
             Hello Time  2 sec  Max Age 20 sec  Forward Delay 15 sec

  Bridge ID  Priority    32769  (priority 32768 sys-id-ext 1)
             Address     0009.7CC8.A0C8
             Hello Time  2 sec  Max Age 20 sec  Forward Delay 15 sec
             Aging Time  300

Interface        Role Sts Cost      Prio.Nbr Type
---------------- ---- --- --------- -------- --------------------------------
Fa0/1            Desg LSN 19        128.1    P2p(这状态有误!)
Fa0/2            Root FWD 19        128.2    P2p
Fa0/3            Altn BLK 19        128.3    P2p

 

你可能感兴趣的:(根防护)