In CCIE wireless lab version 2.0 equipment list Cisco 6506-E listed with 12.2 SXI IP Services feature set. Why this is important when configuring Spanning Tree Protocol (STP) ? From this software code onwards Cisco has changed terminology slightly & you need to be familiar with configuration syntax.
In this post we will see how to configure basic STP features & in the next post look at how to configure optional STP features like Portfast, BPDU Guard, BPDU Filter, Root Guard, etc.
STP(IEEE 802.1D) is a Layer 2 link-management protocol that provides path redundancy while preventing undesirable loops in the network.In an extension known as per-VLAN spanning tree (PVST), Layer 2 Ethernet ports can use STP on all VLANs. By default, a single instance of STP runs on each configured VLAN. The RSTP (802.1w) provides rapid convergence of the spanning tree by assigning port roles and by learning the active topology. The RSTP builds upon the 802.1D STP to select the switch with the highest switch priority (lowest numerical priority value)
STP defines a tree with a root bridge and a loop-free path from the root to all network devices in the Layer 2 network. STP forces redundant data paths into a standby (blocked) state. If a network segment in the spanning tree fails and a redundant path exists, the STP algorithm recalculates the spanning tree topology and activates the standby path.
Spanning Tree will be enabled for all vlans you created on the switch (by default enable it on vlan 1 as well). You can enable/disable it per VLAN level & below show the basic configurations to do that.”default spanning-tree vlan vlan_ID” command will set all STP parameters to default value for that vlan.
6506(config)#spanning-tree vlan vlan_ID 6506(config)#default spanning-tree vlan vlan_ID 6506(config)#no spanning-tree vlan vlan_ID ! 6506#show spanning-tree vlan vlan_ID
If you want to configure extended range vlans (1024 – 4096) you have to enable extended system id for STP. “spanning-tree extend system-id” global configuration commands will do this. “show spanning-tree summary” command can be used to verify this setting.
6506#sh spanning-tree summary Switch is in rapid-pvst mode Root bridge for: VLAN0001, VLAN0160, VLAN0182, VLAN0199, VLAN0438, VLAN0585 VLAN0756, VLAN0783, VLAN0870, VLAN0888-VLAN0889, VLAN0990 EtherChannel misconfig guard is enabled Extended system ID is enabled Portfast Default is disabled Portfast Edge BPDU Guard Default is disabled Portfast Edge BPDU Filter Default is disabled Loopguard Default is disabled Platform PVST Simulation is enabled PVST Simulation Default is enabled but inactive in rapid-pvst mode Bridge Assurance is enabled UplinkFast is disabled BackboneFast is disabled Pathcost method used is short
You can configure STP mode as follows & above command can be used to verify.
6506(config)#spanning-tree mode ? mst Multiple spanning tree mode pvst Per-Vlan spanning tree mode rapid-pvst Per-Vlan rapid spanning tree mode
You can configure a switch to become STP root bridge by changing the bridge priority values which is multiplier of 4096 (0,4096,8192…..,32768,…..,61440).If you want to ensure no other switches become a root, you have set bridge priority to 0 for a given switch for a vlan or vlans. If you want to make another switch to become secondary root, you have to give next lower priority (which is 4096) and leave all other switches default priority (which is 32768) or any other value higher that 4096.
You can also use “spanning tree vlan root primary or secondary” command to do this as well. These commands actualy change the bridge priority value for those in order to make that switch STP primary root (24576) or secondary root (28672) in a given topology. Diameter keyword in the given syntax use to specify the max hops in layer 2 network STP BPDU expect to travel. Once you configure this switch will set optimal BPDU hello time suitable to that topology (I would not change these unless asked to do so)
6506(config)# spanning-tree vlan <vlan_ID or Vlan_Range> priority <Priority_Value> 6506(config)# spanning-tree vlan vlan_ID root primary [diameter hops [hello-time seconds]] 6506(config)# spanning-tree vlan vlan_ID root secondary [diameter hops [hello-time seconds]]
Here is sample configuration if I do this unless asked to do this any otherway (eg. Do not use spanning-tree priority command to do this). Lets say 6506-A should become STP root & 6506-B to be secondary for all vlans.
6506-A(config)#spanning-tree vlan 1-4094 priority 0 ! 6506-B(config)#spanning-tree vlan 1-4094 priority 4096
If a loop occurs, STP considers port priority when selecting a LAN port to put into the forwarding state. You can assign higher priority values to LAN ports that you want STP to select first and lower priority values to LAN ports that you want STP to select last. If all LAN ports have the same priority value, STP puts the LAN port with the lowest LAN port number in the forwarding state and blocks other LAN ports. The possible priority range is 0 through 240 (default 128), configurable in increments of 16.Cisco IOS uses the port priority value when the LAN port is configured as an access port and uses VLAN port priority values when the LAN port is configured as a trunk port.
6506(config)# interface g6/2 6506(config-if)# spanning-tree port-priority port_priority 6506(config-if)#spanning-tree port-priority ? <0-240> port priority in increments of 16 6506(config-if)#spanning-tree vlan 999 port-priority ? <0-240> port priority in increments of 16 6506#sh spanning-tree interface g6/2 Vlan Role Sts Cost Prio.Nbr Type ------------------- ---- --- --------- -------- -------------------------------- VLAN0199 Desg FWD 2 128.144 P2p
The STP port path cost default value is determined from the media speed of a LAN interface. If a loop occurs, STP considers port cost when selecting a LAN interface to put into the forwarding state. You can assign lower cost values to LAN interfaces that you want STP to select first and higher cost values to LAN interfaces that you want STP to select last. If all LAN interfaces have the same cost value, STP puts the LAN interface with the lowest LAN interface number in the forwarding state and blocks other LAN interfaces. The possible cost range is 0 through 200000000 (the default is media specific)
6506(config-if)#spanning-tree cost ? <1-200000000> port path cost 6506(config-if)#spanning-tree vlan 999 ? cost Change an interface's per VLAN spanning tree path cost port-priority Change an interface's spanning tree port priority 6506(config-if)#spanning-tree vlan 999 cost ? <1-200000000> Change an interface's per VLAN spanning tree path cost
Timer values (hello, forwarding-delay,max-age) for STP can be changed by using following configuration commands.
6506(config)# spanning-tree vlan vlan_ID hello-time hello_time(1-10s) <- Default 2s 6506(config)# spanning-tree vlan vlan_ID max-age max_age (6-40s) <- Default 20s 6506(config)# spanning-tree vlan vlan_ID forward-time forward_time (4-30s) <- Default 15s ! 6506#sh spanning-tree vlan 199 bridge Hello Max Fwd Vlan Bridge ID Time Age Dly Protocol ---------------- --------------------------------- ----- --- --- -------- VLAN0199 8391 (8192,199) 0014.1bf6.0140 2 20 15 rstp
That covers the basic STP configuration. Did you notice any specific syntax to 12.2SXI ? No, these specific syntax is required when you configure optional STP features which will look into next few posts.
You can read Cisco IOS Software Configuration Guide-Release 12.2(33)SXH and Later Releases.(Chapter 28) for more detail.