In this video, Russ demonstrates how to configure spanning tree to match your environment. Learn how to change STP modes, set priorities, and adjust VLAN spanning tree topologies.
- [Instructor] Alright, so let's mess around with some of the STP configurations in the real world. Now, the first thing we might want to do in our environment is choose a spanning-tree protocol type. So let's look at our options here. Let's try global configuration mode. And then we're going to go with spanning-tree mode, and then let's look at our options. As you can see, we have multiple spanning-tree mode, we have per-vlan spanning-tree mode, and rapid per-vlan spanning-tree.
So, these are our three options, pvst is what we get right out of the box, let's just exit out of this. Since we got per-vlan spanning-tree, that's fine with me, I'm going to exit here. So, we chose rapid pvst, or pvst, in this case we chose pvst. So, how could we make changes to the priority, for the actual root bridge? Remember, this is going to be a per-vlan instance, right, per-vlan spanning-tree protocol, that's what we chose.
So now we need a way to define where our root bridge is going to be, so the first thing we can do, is go to configure terminal, just go to there again. And then, let's take a look at the command spanning-tree, vlan, and then we're going to work with vlan 10 here. And then we're going to set the priority manually. So what this command is doing is setting the priority on DSwitch1, remember the lower the priority, the better.
So if I wanted DSwitch1 to be the root bridge, I would set this priority lower than any of the other priorities in my environment. So let's look at my options for priority. It says that the bridge priority is in increments of 4,096. This makes a lot of sense, right? This is exactly what we told you that the extended system ID did, you had to increment by 4,096. What if I tried to not increment by 4,096? Let's say I wanted a priority of 10,000.
That is not a multiple of 4,096. When I do that, the switch literally yells at me, and says, "Hey, listen here dummy, it's zero, 4,096, "8,192, all the way up to 61,440. "Those are the multiples of 4,096 you can use." So, let's go ahead and choose 8,192 for our priority, okay? So I'm going to check this command again, I used shift up for that, by the way, if anyone's wondering what I did to bring that command up so quickly.
8,192, so this is saying, for the instance of vlan 10, this switch, DSwitch1 will have a priority of 8,192. It accepted the command, I can exit out of here. And if I wanted to see the effects there, I can go to show, spanning-tree, and then we could go vlan 10. Now, as you can see, this gives me a lot of information, I'm inundated, right, but if I take a deep breath, and start from the top, I can see that we're in vlan10, the priority is 8,202, now wait a second, that's not what we set the vlan priority to.
If we look up, we can see that I set it to 8,192. What's the deal? Well, look down a little further, where it says bridge ID. The priority's 8,202, but it breaks it down for you. The priority's actually 8,192, the system ID is 10 for that vlan 10, you add those together to get a priority of 8,202, excellent. If we take a look at this, we can also see under the root ID, this is the root bridge, and we can also tell that by looking at the interfaces.
You can see that two, three, four, five and 15 are all in the designated role. You remember my little trick, where I taught you that every active port on a root bridge is a designated port, so they're all forwarding, they all have a cost of four, remember, if there's a tie, if we tie at priority, if we tie at cost, if we tie at Mac address, the last thing we look at is that, the port ID number, there you can see, it says priority number there, that's actually the port number that would be used to break that tie, okay, it would be cost, upstream bridge ID, upstream Mac address, and then finally, the port number.
Alright, so what else do we need to look at? Well, that's not the only way I can set up priority, within my environment, let's, now let's go back to global configuration mode. Okay, now that we're here, I'm going to show you a different configuration. Spanning-tree, vlan 20 this time, but this time, I'm going to put in a little bit different of an option, this time I'm going to put in root, and then, let's look at our options.
It can, it says primary and secondary. So think of this command as more of a macro. What's actually going to take place is, spanning-tree protocol's going to look at the topology, for vlan 20 in this case. And in this vlan 20, it's going to take the lowest priority it finds, and if I say primary here, it's going to lower the priority of this switch, below the lowest priority in my topology.
If I chose the value secondary, I'm going to look in my topology, it's going to find the lowest priority and just be one above that. So if anything happens to the root bridge, DSwitch1 will take over the root bridge role from that switch. Let's go ahead and configure it as the secondary, let's do our show spanning-tree vlan 20 and see what we come up with.
It says this, this bridge is the root in this case, I'm not sure what I have the other switches configured to, but if it was possible, this would definitely be the secondary switch. Alright, now one thing I want you to note, where it says vlan 20 spanning-tree enabled protocol I triple E, remember that's for per vlan spanning-tree, for Cisco, that's what that is. When it says protocol I triple E, don't ask me why they chose to do that, kind of confusing, but it's one of those things I really want you to remember.
And the last command, well let's do two more commands. Let's do show CDP neighbors, this lets you know all the switches you're connected to, as you can see, we're connected to LabSwitch1, and LabSwitch2, shows me the interfaces, this is really good for finding out where you are in the topology, and then lastly, we can do show spanning-tree, and I'll just leave it, and what's going to happen here, is you see this is vlan one, going to press space bar, there's vlan 10, vlan 20, vlan 25, so this is going to go through every single switch in my environment.
Let's see, enable I triple E, port address, 50 60 70 80 100, so those are all the vlans, I would go through 'em one by one, with show spanning-tree. Show spanning-tree vlan, and then the number will give you the actual vlan you're looking for. So go ahead in your environments, play with this a little bit, learn their ways of the show command for spanning-tree protocol.
This is the best way to trouble-shoot any issues you have.
- VLAN basics
- Voice VLANs
- VLAN Trunking Protocol
- Spanning Tree Protocol
- How STP modes work
- STP configuration demo
- Logical switching architecture
- Security management