Optional-Spanning-tree-Features_6
- 2017年6月1日
- 読了時間: 4分
STP Loop Guard
・Prevent unidirectional links by using BPDU keepalives
Initialization
SW1(config)#int range e0/1,e0/2-3,e1/1 SW1(config-if-range)#shut SW2(config)#int range e0/0-1,e0/3,e1/1 SW2(config-if-range)#shut
SW2(config)#int e0/2 SW2(config-if)#no shut SW2(config-if)#switchport trunk encapsulation dot1q SW2(config-if)#switchport mode trunk SW3(config)#int range e0/1,e0/3,e1/0-1 SW3(config-if-range)#shut SW3(coSW2(config)#int e0/2 SW3(config-if)#no shut SW3(config-if)#switchport trunk encapsulation dot1q SW3(config-if)#switchport mode trunk SW4(config)#int range e0/0-3,e1/0-1 SW4(config-if-range)#shut
SW1#sh spanning-tree vlan 2 VLAN0002 Spanning tree enabled protocol ieee Root ID Priority 4098 Address aabb.cc00.0100 This bridge is the root Hello Time 2 sec Max Age 20 sec Forward Delay 15 sec Bridge ID Priority 4098 (priority 4096 sys-id-ext 2) Address aabb.cc00.0100 Hello Time 2 sec Max Age 20 sec Forward Delay 15 sec Aging Time 300 sec Interface Role Sts Cost Prio.Nbr Type ------------------- ---- --- --------- -------- -------------------------------- Et0/0 Desg FWD 100 128.1 Shr Et1/0 Desg FWD 100 128.5 Shr SW2#sh spanning-tree vlan 2 VLAN0002 Spanning tree enabled protocol ieee Root ID Priority 4098 Address aabb.cc00.0100 Cost 100 Port 5 (Ethernet1/0) Hello Time 2 sec Max Age 20 sec Forward Delay 15 sec Bridge ID Priority 16386 (priority 16384 sys-id-ext 2) Address aabb.cc00.0200 Hello Time 2 sec Max Age 20 sec Forward Delay 15 sec Aging Time 300 sec Interface Role Sts Cost Prio.Nbr Type ------------------- ---- --- --------- -------- -------------------------------- Et0/2 Desg FWD 100 128.3 Shr Et1/0 Root FWD 100 128.5 Shr SW3#show spanning-tree vlan 2 VLAN0002 Spanning tree enabled protocol ieee Root ID Priority 4098 Address aabb.cc00.0100 Cost 100 Port 1 (Ethernet0/0) Hello Time 2 sec Max Age 20 sec Forward Delay 15 sec Bridge ID Priority 32770 (priority 32768 sys-id-ext 2) Address aabb.cc00.0300 Hello Time 2 sec Max Age 20 sec Forward Delay 15 sec Aging Time 300 sec Interface Role Sts Cost Prio.Nbr Type ------------------- ---- --- --------- -------- -------------------------------- Et0/0 Root FWD 100 128.1 Shr Et0/2 Altn BLK 100 128.3 Shr

Normal Enable BPDU filter SW3 on e0/0 so that stop receiving BPDU. SW3(config)#int e0/0 SW3(config-if)#spanning-tree bpdufilter enable (after 20 sec) *Jun 1 14:29:06: STP: VLAN0002 new root port Et0/2, cost 200 *Jun 1 14:29:06: STP: VLAN0002 Et0/2 -> listening *Jun 1 14:29:08: STP: VLAN0001 new root port Et0/2, cost 200 *Jun 1 14:29:08: STP: VLAN0001 Et0/2 -> listening *Jun 1 14:29:21: STP: VLAN0002 Et0/2 -> learning *Jun 1 14:29:23: STP: VLAN0001 Et0/2 -> learning *Jun 1 14:29:36: STP[2]: Generating TC trap for port Ethernet0/2 *Jun 1 14:29:36: STP: VLAN0002 sent Topology Change Notice on Et0/2 *Jun 1 14:29:36: STP: VLAN0002 Et0/2 -> forwarding *Jun 1 14:29:38: STP[1]: Generating TC trap for port Ethernet0/2 *Jun 1 14:29:38: STP: VLAN0001 sent Topology Change Notice on Et0/2 *Jun 1 14:29:38: STP: VLAN0001 Et0/2 -> forwarding SW3#sh span vl 2 VLAN0002 Spanning tree enabled protocol ieee Root ID Priority 4098 Address aabb.cc00.0100 Cost 200 Port 3 (Ethernet0/2) Hello Time 2 sec Max Age 20 sec Forward Delay 15 sec Bridge ID Priority 32770 (priority 32768 sys-id-ext 2) Address aabb.cc00.0300 Hello Time 2 sec Max Age 20 sec Forward Delay 15 sec Aging Time 15 sec Interface Role Sts Cost Prio.Nbr Type ------------------- ---- --- --------- -------- -------------------------------- Et0/0 Desg FWD 100 128.1 Shr Et0/2 Root FWD 100 128.3 Shr E0/2 was elected new Root Port, but e0/0 became forwarding state because not receive BPDUs. This topology have Loop.

SW3(config)#int e0/0 SW3(config-if)#no spanning-tree bpdufilter enable
Loop Guard enable SW3(config)#int e0/0 SW3(config-if)#spanning-tree guard loop
SW3#sh spanning-tree int e0/0 detail Port 5 (Ethernet0/0) of VLAN0002 is designated forwarding Port path cost 100, Port priority 128, Port Identifier 128.5. Designated root has priority 4098, address aabb.cc00.0100 Designated bridge has priority 32770, address aabb.cc00.0300 Designated port id is 128.5, designated path cost 100 Timers: message age 0, forward delay 0, hold 0 Number of transitions to forwarding state: 1 Link type is shared by default Loop guard is enabled on the port BPDU: sent 1307, received 0
SW3(config-if)#spanning-tree bpdufilter enable (after 20 sec) *Jun 1 15:03:13: STP[1]: Generating TC trap for port Ethernet0/0 *Jun 1 15:03:13: STP: VLAN0001 Et0/0 -> blocking %SPANTREE-2-LOOPGUARD_BLOCK: Loop guard blocking port Ethernet0/0 on VLAN0001. *Jun 1 15:03:13: STP: VLAN0001 new root port Et0/2, cost 200 *Jun 1 15:03:13: STP: VLAN0001 Et0/2 -> listening *Jun 1 15:03:13: STP[2]: Generating TC trap for port Ethernet0/0 *Jun 1 15:03:13: STP: VLAN0002 Et0/0 -> blocking *Jun 1 15:03:13: STP: VLAN0002 new root port Et0/2, cost 200 *Jun 1 15:03:13: STP: VLAN0002 Et0/2 -> listening *Jun 1 15:03:15: STP: VLAN0001 sent Topology Change Notice on Et0/2 *Jun 1 15:03:15: STP: VLAN0002 sent Topology Change Notice on Et0/2 *Jun 1 15:03:28: STP: VLAN0001 Et0/2 -> learning *Jun 1 15:03:28: STP: VLAN0002 Et0/2 -> learning *Jun 1 15:03:43: STP[1]: Generating TC trap for port Ethernet0/2 *Jun 1 15:03:43: STP: VLAN0001 sent Topology Change Notice on Et0/2 *Jun 1 15:03:43: STP: VLAN0001 Et0/2 -> forwarding *Jun 1 15:03:43: STP[2]: Generating TC trap for port Ethernet0/2 *Jun 1 15:03:43: STP: VLAN0002 sent Topology Change Notice on Et0/2 *Jun 1 15:03:43: STP: VLAN0002 Et0/2 -> forwarding SW3#show spanning-tree vlan 2 VLAN0002 Spanning tree enabled protocol ieee Root ID Priority 4098 Address aabb.cc00.0100 Cost 200 Port 3 (Ethernet0/2) Hello Time 2 sec Max Age 20 sec Forward Delay 15 sec Bridge ID Priority 32770 (priority 32768 sys-id-ext 2) Address aabb.cc00.0300 Hello Time 2 sec Max Age 20 sec Forward Delay 15 sec Aging Time 15 sec Interface Role Sts Cost Prio.Nbr Type ------------------- ---- --- --------- -------- -------------------------------- Et0/0 Desg BKN*100 128.1 Shr *LOOP_Inc Et0/2 Root FWD 100 128.3 Shr When it had not received BPDU during 20 sec (max age) ,
e0/0 that enabled Loop Guard become Loop Inconsistent status, so prevent loop.

Here is my CCNP note : STP otional feature summary.
