Wednesday, March 11, 2015

Root Guard

=====================================================================
  • Protects the topology from "rogue" root switches
    • Switch sending superior BPDUs
      • Lower priority or MAC than current root
      • Better root path cost than the local port
  • Configured per-port
    • Not vlan-aware
  • Block the port upon receiving a superior BPDU
    • "Root Inconsistent" state in Spanning-tree
    • State cleard after these BPDUs stop arring
    • Unlike blocking state, BPDUs are sent out

SW3#show spanning-tree vlan 1
VLAN0001
  Spanning tree enabled protocol ieee
  Root ID    Priority    32769
             Address     aabb.cc00.0100
             Cost        100
             Port        3 (Ethernet0/2)
             Hello Time   2 sec  Max Age 20 sec  Forward Delay 15 sec

  Bridge ID  Priority    32769  (priority 32768 sys-id-ext 1)
             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/1               Altn BLK 100       128.2    Shr
Et0/2               Root FWD 100       128.3    Shr
Et0/3               Desg FWD 100       128.4    Shr


=> SW1 is root with priotiy = 32768
SW1# *Sep 28 08:01:56.165: STP: VLAN0001 Et0/0 tx BPDU: config protocol=ieee
    Data : 0000 00 00 00 8001AABBCC000100 00000000 8001AABBCC000100 8001 0000 1400 0200 0F00

================================================================

Khi them SW4 vao , voi gia tri priority = 4096 is the best. SW3 nhan superior BPDU  = > STP se chay lai toan bo mang va binh chon SW4 lam vai tro root.
De tranh truong hop nay tren e0/3 SW3 tien hanh cau hinh root guard . Khi e0/3 SW3 nhan superior BPDU -> interface e0/3 se o trang thai Root inconsistent ( tuong tu nhu trang thai block) se khong gui BPDU, nhung van nhan. Port se chuyen sang trang thai khac khi khong con nhanh superior BPDU ( no se so sanh 2 BPDU giu SW1 va SW 4 de nhan biet superior BPDU)


 *Sep 28 08:11:14.165: STP: VLAN0001 sent Topology Change Notice on Et0/2
*Sep 28 08:11:14.165: STP[1]: Generating TC trap for port Ethernet0/3
*Sep 28 08:11:17.172: set portid: VLAN0001 Et0/3: new port id 8004
*Sep 28 08:11:17.172: STP: VLAN0001 Et0/3 -> listening
*Sep 28 08:11:17.570: STP: VLAN0001 heard root  4097-aabb.cc00.0400 on Et0/3
*Sep 28 08:11:17.570:     supersedes 32769-aabb.cc00.0100
*Sep 28 08:11:17.570: %SPANTREE-2-ROOTGUARD_BLOCK: Root guard blocking port Ethernet0/3 on VLAN0001.
*Sep 28 08:11:17.570: STP: VLAN0001 Et0/3 -> blocking

*Sep 28 08:11:19.172: STP: VLAN0001 heard root  4097-aabb.cc00.0400 on Et0/3
*Sep 28 08:11:19.172:     supersedes 32769-aabb.cc00.0100

*Sep 28 08:11:21.174: STP: VLAN0001 heard root  4097-aabb.cc00.0400 on Et0/3
*Sep 28 08:11:21.174:     supersedes 32769-aabb.cc00.0100
===============================================================

SW3#show spanning-tree vlan 1

VLAN0001
  Spanning tree enabled protocol ieee
  Root ID    Priority    32769
             Address     aabb.cc00.0100
             Cost        100
             Port        3 (Ethernet0/2)
             Hello Time   2 sec  Max Age 20 sec  Forward Delay 15 sec

  Bridge ID  Priority    32769  (priority 32768 sys-id-ext 1)
             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/1               Altn BLK 100       128.2    Shr
Et0/2               Root FWD 100       128.3    Shr
Et0/3               Desg BKN*100       128.4    Shr *ROOT_Inc

=========================================================================
SW3#show span int e0/3 de
 Port 4 (Ethernet0/3) of VLAN0001 is broken  (Root Inconsistent)
   Port path cost 100, Port priority 128, Port Identifier 128.4.
   Designated root has priority 32769, address aabb.cc00.0100
   Designated bridge has priority 32769, address aabb.cc00.0300
   Designated port id is 128.4, designated path cost 100
   Timers: message age 1, forward delay 0, hold 0
   Number of transitions to forwarding state: 0
   Link type is shared by default
   Root guard is enabled on the port
   BPDU: sent 1, received 42    // chi nhan BPDU cua SW4 nhung k gui BPDU SW1 ra

============================================================
Cau hinh priority SW4 = 40960 (not superior BPDU)

*Sep 28 08:14:13.604: STP: VLAN0001 heard root 40961-aabb.cc00.0400 on Et0/3
*Sep 28 08:14:31.603: %SPANTREE-2-ROOTGUARD_UNBLOCK: Root guard unblocking port Ethernet0/3 on VLAN0001.
*Sep 28 08:14:31.603: STP: VLAN0001 Et0/3 -> listening
*Sep 28 08:14:31.607: STP: VLAN0001 heard root 40961-aabb.cc00.0400 on Et0/3
*Sep 28 08:14:31.612: STP: VLAN0001 Topology Change rcvd on Et0/3
*Sep 28 08:14:31.612: STP: VLAN0001 sent Topology Change Notice on Et0/2
*Sep 28 08:14:46.603: STP: VLAN0001 Et0/3 -> learning
*Sep 28 08:15:01.605: STP[1]: Generating TC trap for port Ethernet0/3
*Sep 28 08:15:01.606: STP: VLAN0001 sent Topology Change Notice on Et0/2
*Sep 28 08:15:01.606: STP: VLAN0001 Et0/3 -> forwarding


=========================================================
SW3#show spanning-tree vlan 1

VLAN0001
  Spanning tree enabled protocol ieee
  Root ID    Priority    32769
             Address     aabb.cc00.0100
             Cost        100
             Port        3 (Ethernet0/2)
             Hello Time   2 sec  Max Age 20 sec  Forward Delay 15 sec

  Bridge ID  Priority    32769  (priority 32768 sys-id-ext 1)
             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/1               Altn BLK 100       128.2    Shr
Et0/2               Root FWD 100       128.3    Shr
Et0/3               Desg FWD 100       128.4    Shr

=========================================================================
SW3#show span int e0/3 de
 Port 4 (Ethernet0/3) of VLAN0001 is designated forwarding
   Port path cost 100, Port priority 128, Port Identifier 128.4.
   Designated root has priority 32769, address aabb.cc00.0100
   Designated bridge has priority 32769, address aabb.cc00.0300
   Designated port id is 128.4, 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
   Root guard is enabled on the port
   BPDU: sent 61, received 91

Note : chi co root moi gui BPDU voi time = 2s. Con nhung SW khac se gui goi tin TCN, config khi topo co su thay doi.


No comments:

Post a Comment