All right, we're jumping back into the lab here to take a look at cost
configuration.
And I've got this same topology here.
Switch 5 is also down there, but it's not going to be part of this
demonstration.
We'll notice that we have a couple of links now between switch 2 and switch 4,
which is
going to play into our report priorities conversation coming up.
Our focus is going to be on cost manipulation here.
We're going to find that switch 4 has its link to switch 2.
Both of these links actually are in a blocking state.
And the reason for that is because, as we might recall from previous time WEBVTT X-TIMESTAMP-MAP=LOCAL:00:00:00.000,MPEGTS:900000
And the reason for that is because, as we might recall from previous time
suspended
in this lab, that switch 3 has actually the best MAC address in the entire
network.
And so if I want to double check to make sure switch 1 is the root, I've got a
priority
statement on here that's going to make the root, or make switch 1 the root, it
's set
at 4K.
And so the question is going to be, can I change the blocking port to be
pointing now towards
switch 3?
So just to get some interfaces on here as well, this is going to be gig 1 0 WEBVTT X-TIMESTAMP-MAP=LOCAL:00:00:00.000,MPEGTS:900000
So just to get some interfaces on here as well, this is going to be gig 1 0
here pointing
to switch 3.
And then we've got gig 0 slash 2 and 0 slash 3 going up to switch 2.
So let's go ahead and take a look at this.
I'll leave the diagram up as long as it's not in the way.
And so switch 1, I'm going to do a show spanning tree VLAN 1 root.
We'll just focus on VLAN 1 here.
And we see no root port, which as we just talked about, there's means there's
no upstream
port, it means it is the root. WEBVTT X-TIMESTAMP-MAP=LOCAL:00:00:00.000,MPEGTS:900000
port, it means it is the root.
So that is a good way to verify that.
But also notice, if I do a show spanning tree, I'm going to find that the costs
are 4 here
and 4, that's a pretty good indication we're running the short path cost.
Let's go and convert everything over to the long path cost.
The way we do that, it's the global configuration and it's spanning tree path
not patch cost,
path cost, and then method.
And we see that we've got short and long short is still the default method. WEBVTT X-TIMESTAMP-MAP=LOCAL:00:00:00.000,MPEGTS:900000
And we see that we've got short and long short is still the default method.
So I'm going to change this to method long.
So now if I do a show spanning tree, I'm going to find that my costs are now 20
,000.
It's the same bandwidth.
It's still gig interfaces, but spanning tree considered it to have a cost of 20
,000.
So I'm going to go ahead and get on to switch to and switch through and do the
same thing.
So spanning tree path cost method long and switch three same thing, spanning WEBVTT X-TIMESTAMP-MAP=LOCAL:00:00:00.000,MPEGTS:900000
So spanning tree path cost method long and switch three same thing, spanning
tree path
cost method long.
So let's go over to switch four.
And at this point, this is the only switch that's still running short path
costs.
If I do a show spanning tree for VLAN one, we'll see that first of all, we are
blocking
the ports that we expect to block.
And we've got the root port still is gig one zero pointing to switch three, but
the costs
are still short.
It's four on each interface.
So then we glance up here to say, okay, well, what is my path cost to root? WEBVTT X-TIMESTAMP-MAP=LOCAL:00:00:00.000,MPEGTS:900000
So then we glance up here to say, okay, well, what is my path cost to root?
And we see it's 20,000 for the exact number we used in the chalkboarding
session, but it's
indicative of what's happening here.
So if I look at this, what we have is we've got a cost of four on, whoops,
wrong link,
this link down here, but switch three has a cost link of 20,000.
So it's advertising a cost of 20,000 in switch four doesn't have any idea
whether switch
three has long path costs or a static configuration or just an insanely long WEBVTT X-TIMESTAMP-MAP=LOCAL:00:00:00.000,MPEGTS:900000
three has long path costs or a static configuration or just an insanely long
path to the root.
Either way, it's going to trust that it's a 20,000 cost being advertised.
It's going to add its own four.
And that's why it thinks it has a cost of 20,000 for.
And so that's exactly what's happening and why we can technically mix and match
our long
and short path costs.
We just don't ever want to do that in production.
That would again, create some unexpected results at times. WEBVTT X-TIMESTAMP-MAP=LOCAL:00:00:00.000,MPEGTS:900000
That would again, create some unexpected results at times.
So let's make it match.
We're going to do the same configuration.
So spanning tree path cost method long on switch four.
And now we would expect it to see a root path cost of 20,000 plus 20,000 20,000
for each
link should be 40,000.
If I do my show spanning tree, VLAN one root command, it also gives the root
cost of 40,000.
So there it is listed and everything should be fully synchronized at this point
.
So now we look at the scenario where once again, just like we talked about on WEBVTT X-TIMESTAMP-MAP=LOCAL:00:00:00.000,MPEGTS:900000
So now we look at the scenario where once again, just like we talked about on
in the
chalkboard, let's say that switch three here, we want to avoid switch three.
I really would rather block this link rather than both of the links to switch
two.
Now I can't have both of those links up at the same time, not without bundling
them together
as an ether channel.
But since they're separate, I would going to have to, I'm going to have to have
one
of them blocked.
But the other one could come up.
It doesn't matter which one of these comes online, but let's say that I want to WEBVTT X-TIMESTAMP-MAP=LOCAL:00:00:00.000,MPEGTS:900000
It doesn't matter which one of these comes online, but let's say that I want to
block
to switch three.
What can I do?
Well, this is where I can start to adjust the cost.
So I could do one of two things here.
I could consider increasing the cost here on gig one zero because right now I
basically
have the exact same cost coming in.
This is 20k here.
This is 20k.
So both switches are advertising a root path cost of 20,000.
I bring them in on gig interfaces.
So either way, I've got a 40,000 path going to switch two and a 40,000 path WEBVTT X-TIMESTAMP-MAP=LOCAL:00:00:00.000,MPEGTS:900000
So either way, I've got a 40,000 path going to switch two and a 40,000 path
going to switch
three.
So the cost is identical right now, which is why I could increase the cost this
way and
make it maybe 80k or something like that.
And then I would prefer the shorter path.
Alternatively, I could lower the cost up here, maybe make it 5k.
So at that point, this would be 25k, which is better than 40k.
And so I would prefer that path. WEBVTT X-TIMESTAMP-MAP=LOCAL:00:00:00.000,MPEGTS:900000
And so I would prefer that path.
It doesn't matter which one I choose, but I would have to manipulate one of
these and
you know, it could technically do both if we wanted to.
So let's go ahead and do the first one.
Let's increase cost over here because it only requires configuring a single
link.
We'll get on to gig one zero and we'll make this cost, let's just make it cost
100,000.
And so now our cost should be 120k.
The advertised 20 plus my link cost of 100k. WEBVTT X-TIMESTAMP-MAP=LOCAL:00:00:00.000,MPEGTS:900000
The advertised 20 plus my link cost of 100k.
Yeah, 100k.
That's what we're talking about configuring.
So I'm on switch four here.
I'm going to get on to the interface and gig one slash zero.
And now I've got the spanning tree cost command.
Now notice if I do spanning tree cost 100,000, this is going to apply it to all
the VLANs.
Meanwhile, I could specify the VLAN VLAN one and then I can change the cost in
the same
way.
It's just going to impact whether or not the cost is this, you know, placed for WEBVTT X-TIMESTAMP-MAP=LOCAL:00:00:00.000,MPEGTS:900000
It's just going to impact whether or not the cost is this, you know, placed for
all VLANs
or just one.
So we'll demonstrate that here in a moment.
So I'm just going to set VLAN ones cost to 100,000.
And then I can do this great command show spanning tree interface, gig one zero
, and
it shows me the cost on a per VLAN basis as well as the status.
This is a great command.
I want to see what's happening on a specific interface.
And so we see the cost is 100,000, but only for VLAN one.
VLANs 10, 20, and 30 are still using the default long path cost of 20k. WEBVTT X-TIMESTAMP-MAP=LOCAL:00:00:00.000,MPEGTS:900000
VLANs 10, 20, and 30 are still using the default long path cost of 20k.
So at this point, we are expecting that switch four has moved this into a
blocking state.
I can do the show spanning tree blocked ports command.
And for VLAN one, actually, that's the only VLAN that has blocked ports, we are
still
blocking an upstream port.
And we had to unblock one of these, but it does appear that we have unblocked
gig zero
three kept keeping gig zero to a blocked state.
And importantly, we are now blocking gig one slash zero. WEBVTT X-TIMESTAMP-MAP=LOCAL:00:00:00.000,MPEGTS:900000
And importantly, we are now blocking gig one slash zero.
And so that's exactly what we wanted to have happen.
So again, we could have manipulated the cost upstream over here, but we would
have had
to pick an interface.
And so at this point, now we could say, hey, what if I wanted to block the
other interface
what if I wanted to block gig zero three?
Well, I could make gig zero two more favorable.
Because right now both of the costs coming in are being advertised as 20k
received as WEBVTT X-TIMESTAMP-MAP=LOCAL:00:00:00.000,MPEGTS:900000
received as
20k.
So if this is a 40k path and this is a 40k path, then they're favored the same
and we're
going to have to choose one based on the port priority concept that we talked
about earlier.
But what if I wanted to force to the path this way?
What if I wanted to open this link up?
Well, what I could do is leave this as a 20k cost, but then make this interface
gig zero
two, let's make this a 10k cost. WEBVTT X-TIMESTAMP-MAP=LOCAL:00:00:00.000,MPEGTS:900000
two, let's make this a 10k cost.
And so let's go ahead and do that real quick.
Remember this is an inbound configuration.
So I can get on to interface gig zero two.
This is the current blocked port and say, in fact, let's just do spanning tree
cost.
And I said I'd do 10,000.
So spanning tree cost 10,000.
Now if I do a show spanning tree gig interface gig zero two, there we go.
We got it out.
Notice that because I didn't specify a VLAN, now it's set the cost to be 10,000 WEBVTT X-TIMESTAMP-MAP=LOCAL:00:00:00.000,MPEGTS:900000
Notice that because I didn't specify a VLAN, now it's set the cost to be 10,000
for all
of the VLANs.
And so if I do my show spanning tree VLAN one, we should now see that, yep, we
are have
declared gig zero two to be the root.
We're still going through the listening and learning phases.
We're almost done there.
But gig zero three was placed into blocking, which means my final diagram is
actually
going to look like this, where I'm blocking these two links as shown. WEBVTT X-TIMESTAMP-MAP=LOCAL:00:00:00.000,MPEGTS:900000
going to look like this, where I'm blocking these two links as shown.
And this link right here is indeed my root port.
So I was able to do all of that on switch for using my spanning tree cost
commands, keeping
in mind that the cost manipulations go on to the inbound interfaces.
And that's what allows me to determine which ports in the network are blocked
and kind
of go against the default settings that spanning tree would have decided
otherwise.