How To Configure Spanning Tree
Spanning tree selects the root port based on the path cost. The port with the lowest path cost to the root bridge becomes the root port. The root port is always in the forwarding state. If the speed/duplex of the port is changed, spanning tree recalculates the path cost automatically. Dec 7, 2016 - This chapter describes how to configure the Spanning Tree Protocol (STP) on a Catalyst 4500 series switch. This chapter also describes how to.
- Spanning-tree Vlan 1-4094 Root Primary
- Configuring Spanning Tree Protocol
- How To Configure Spanning Tree For Spine Leaf
Setting up Spanning Tree on HP switches is really easy, after you've done it a couple of times, but getting it configured can seem like a daunting task for beginners, esp. in a production network. Here are some simple steps on how to get it up and running in no time. Note that enabling STP might cause small network outages, so don't do this in a production network if you haven't tried it before!
3 Steps total
Step 1: Start up STP
Select your root bridge (the central most switch in your network). Enter CLI and type 'configure' to enter config mode. Then enter 'spanning-tree' to enable it. That's all you need to do on a switch to get STP up and running.
Spanning-tree Vlan 1-4094 Root Primary
Step 2: Set root bridge priority
Configuring Spanning Tree Protocol
When the switches in your network selects their root bridge, they look at two things, the switch's MAC-address, and a thing called STP priority. From the factory all switches have the same priority (step 8 of the 16 configurable steps) so the switch with the lowest MAC automatically get's selected as root. THIS IS NOT A GOOD THING, as this will basically make your whole network look for the shortest path to a random switch in the network. What we want is for them to find the shortest path to the core switch, so we will alter the priority.
This is easy to do as well. In the same config mode that you just enabled STP in, type 'spanning-tree priority 0'. This sets the root bridge permanently so that it won't ever change without you wanting it. If you have 2 core switches, set the other one to priority 1 so that if the main core fails the whole network will switch to the other one.
Run 'write memory' to save your changes and log out.
Step 3: Repeat Step 1 on all your other switches
Run 'spanning-tree' in the config mode on all your other switches. That's all! Remember to run 'write memory' to save your changes!
How To Configure Spanning Tree For Spine Leaf
This is only a short intro into STP, but it's sufficient for beginners to get started, and after you have this down you can then easily start to add the more exotic features.
Here's the full CLI for those who want it;
Configuring the Root Bridge:
Procurve 4204vl-1# configure
Procurve 4204vl-1(config)# spanning-tree
Procurve 4204vl-1(config)# spanning-tree priority 0
Procurve 4204vl-1(config)# write memory
Configuring the other switches:
Procurve 4204vl-2# configure
Procurve 4204vl-2(config)# spanning-tree
Procurve 4204vl-2(config)# write memory
References
- Grumpy Techie - How to set up STP on HP Switches
5 Comments
- JalapenoToledoTown Jul 15, 2013 at 12:53pm
Thanks for the post, good STP insight. Here is some more:
http://www.networkworld.com/community/blog/9-common-spanning-tree-mistakes - Ghost ChiliNick42 Aug 13, 2013 at 11:38pm
with all the docs on tweaking STP on Cisco, this is a pretty cool find.
- HabaneroPriscilla@HP Oct 3, 2013 at 11:23pm
Thank you for providing another helpful document to which I can direct HP Networking customers.
- Pimientomahmad786 Aug 9, 2016 at 07:11am
(hp5800)# spanning-tree priority 0
When I tried to set priority 0. It breaks link with every thing.
Any idea Y - CayenneStuggi Aug 9, 2016 at 07:19am
That's normal for a short while, it breaks every link since every switch in the network has to find the shortest path to the root bridge. If it's longer than a minute, then you have some other issue. Remember that BDPU messages doesn't take VLANs into account, so if you have links that form a loop on Layer 1, STP will shut those down even though they might be in separate VLANs and not forming a loop on L2.
Comments are closed.