- Order of Operations:
- Elect the root bridge.
- After a root bridge has been selected, all of it’s ports will be set into designated ports that are forwarding downstream.
- Select root bridge interfaces.
- Each non-root switch will look through ports and elect a root port that is pointed at the root bridge.
- All other ports will be elected as designated ports that are pointing further downstream.
- All ports not in designated will be in blocking.
- Elect the root bridge.
- Root Bridge Election:
- Lowest Bridge ID wins.
- Bridge ID contains:
- Bridge priority (0-61440)
- System ID (0-4095)
- MAC address
- Bridge ID contains:
- Lowest Bridge ID wins.
- Changing Root Bridge Election:
- Change bridge priority manually
- ‘spanning-tree vlan <vlan id> priority <priority number by 4096>
- Use root bridge command
- ‘spanning-tree vlan <vlan id> root <primary or secondary>
- Will set local priority based on current Root Bridge priority
- ‘show spanning tree root’ will show which switch is root.
- Change bridge priority manually
- Root Port Election:
- Root Port is upstream pointing towards the Root Bridge.
- Selected as RP based on lowest path cost (all link costs added up)
- Higher bandwidth = lower cost – ie. Fa is 19, 1Gbps is 4
- When a cost tie occurs:
- Lowest upstream bridge ID
- Lowest upstream port ID

- Root Port priority:
- Per above, lowest wins.
- Root Port priority can be changed locally, which will then impact the downstream switch.
- Image above shows root port as Gi1/1 to SW1. If Gi1/1 receives the following config, then the root port is changed to Gi1/2 instead:
- switch(config-int)#spanning-tree port-priority 240
- Image above shows root port as Gi1/1 to SW1. If Gi1/1 receives the following config, then the root port is changed to Gi1/2 instead:

- ‘show spanning-tree vlan <id> detail’
- Will display the local and remote port IDs.
- Useful for modifying traffic flow in bridging domain.

- Changing paths when not changing which switch is Root Bridge.
- switch(config-int)#spanning-tree vlan <#> cost <#>
- Command above will change the link cost locally on a switch.
- By adding all link costs up towards the bridge, we can modify which port is a root bridge locally.
- Changing paths can be done with the bandwidth command as well.
- Bandwidth is connected to STP cost.
- switch(config-int)#spanning-tree vlan <#> cost <#>
- Plain Spanning Tree Protocol timers
- Hello – How often BPDUs are sent out interfaces.
- Defaults to 2 seconds
- MaxAge – How long to wait in blocking without a BPDU
- Defaults to 20 seconds.
- Forward Delay – How long to wait in listening and learning
- Defaults to 15 seconds
- Hello – How often BPDUs are sent out interfaces.
- PortFast
- Bypasses Forwarding Delay
- For ports not running spanning tree
- ‘switch(config-if)#spanning-tree portfast’
- UplinkFast
- Legacy for ‘Alternate port’ when root port dies.
- Automatically switches alternative port to forwarding when root goes down.
- ‘switch(config)#spanning-tree uplinkfast’
- Automatically changes all port priorities when root port dies.
- Way to tell all other switches that it is not the root.
- BackboneFast
- Indirect failures should start recalculating immediately.
- BPDU Filter
- Filters BPDUs both in and out.
- Used on Edge ports to transition port to STP speaking member if it receives BPDU.
- OUT OF EDGE STATE
- ‘switch(config)#spanning-tree portfast bpdufilter default’
- BPDU Guard
- Listens for BPDUs and if it receives one the interface will be put in err-disabled.
- Can run an err-disabled cause command to bring interface back up after specific interval.
- Root Guard
- Shuts ports down if it receives an additional BPDU with better priority.
- Can be configured with Portfast.
- switch(config-int)#spanning-tree guard root
- Loop Guard
- Prevents unidirectional links by using BPDU keepalives.
- ‘switch(config)#spanning-tree loopguard default’
- ‘switch(config-if)#spanning-tree loopguard enable’
- Unidirectional Link Detection
- Prevents unidirectional links by using UDLD keepalives.