So once again on switch 1, sh spanning-tree VLAN 1
shows us that these ports are blocking
1, 2 and 3 are blocking for VLAN 1
same for VLAN 10, 1, 2 and 3 are blocking.
So what we will do now is go to global config mode
and type spanning-tree
because this is per-VLAN Spanning Tree I can do this on a per-VLAN basis.
So I’m gonna specify VLAN 10
and I’m gonna change the priority of the switch to 0.
So previously notice in the bridge ID
the switch priority was 32778
in other words the default priority + the VLAN number of 10.
do sh spanning-tree VLAN 10
now shows me that the priority of the switch is 10
in other words priority 0 + VLAN number gives me a priority of 10
and this switch is now the root of VLAN 10.
The ports are going through different states at the moment
so we're at learning state and now the ports are forwarding
now we need to do a lot of Spanning Tree optimization here
the first thing we’ve done is made this switch the root for VLAN 10
but we also want to change the port type to allow Rapid Spanning Tree
to converge a lot quicker than it's converging at the moment.
We want to make this point-to-point links in Spanning Tree
and we'll get to that in a moment
but for now, what we’ve done is made this switch the root for VLAN 10
and let’s do the same for VLAN 1
so sh spanning-tree vlan 1
we can see that these ports are currently blocking
but after a period of time, they should go to learning and there you go
so they go to blocking, listening and then learning
and now they go to forwarding
so the ports are now forwarding on the switch
so this is better than what we had previously.
The switch priority is 1 because we set the priority to 0 + the VLAN number of 1
this switch is the root switch.
So we’ve made this switch the root for VLAN 1 and VLAN 10
we want to make the switch 2 the root now for VLAN 20.
So on switch 2, conf t spanning-tree vlan 20 priority 0
sh spanning-tree vlan 20
switch priority is now 20 in other words 0 + the VLAN number
switch is the root, the switch is forwarding in all ports
the switch was the root previously for VLAN 20
so hence the port stayed as forwarding
because the switch was the root but notice now for VLAN 1
the switch is forwarding on all ports but blocking on gigabit 0/1.
Back on switch 1, let’s look at the Spanning Tree for VLAN 20
this is still not good because the switch is still blocking port 3, 2 and 1.
so to optimize this
we want to make this switch the backup root switch for VLAN 20
and to do that we're going to type spanning-tree vlan 20 priority
and I can't enter a priority of 1 because it must be in multiple of 4096
so the next lowest priority that I can use is 4096.
So do sh spanning-tree vlan 20 now
shows me that this ports 2 and 3 are designated ports
where’s previously they were alternate ports.
After period of time, we should see the ports go forwarding
so they're currently learning, still learning while we waiting for that
notice gigabit 0/1 is still an alternate port
and is blocking because we have 2 ports to the same root switch.
But now notice 0/0 is forwarding its root port
these 2 ports are forwarding, so 2 and 3 are forwarding
as they are now designated ports.
This is better than what we had before.
so sh run | include span
this command were enabled by default
but what we’ve done now is make the switch the root bridge for VLANs 1 and 10
and the backup root for VLAN 20
on switch 2 we need to make this switch the backup root bridge for VLAN 10
and VLAN 1, so set the priority for VLAN 10 to 4096
and do the same for VLAN 1
sh run | include spanning-tree
so this 2 once again with default commands
we’ve made switch 2 the backup root switch for VLANs 1 and 110
and the root for VLAN 20.
So in our topology, this switch is the root for VLANs 1 and 10
and this switch is the root for VLAN 20
they are both back up roots for each other
in other words, these ports are forwarding on both the switches.
The only port that’s blocking is this port on both the core switches
and we're going to improve that in a moment by running EtherChannel
but once again sh spanning-tree vlan 10
for VLAN 10 all ports are forwarding
for VLAN 20 all ports are forwarding
except for this link between the 2 core switches.
And for VLAN 1 all ports are forwarding because this is the root bridge.
Something similar can be seen on switch 2
sh spanning-tree vlan 10
alternate port is this one here
0/1 same can be seen for VLAN 1
this port is the alternate port.
But for VLAN 20, all ports are forwarding.
So we’ve improved the Spanning Tree
by making this switch the root for some VLANs
and this switch the root for other VLANs
Let’s have a look at the access switches.
On access switch 3, show run | include span
the default Spanning Tree configuration has been done
we haven't done anything additionally here.
So let’s have look at VLAN 10
the root port for VLAN 10 is this port gigabit 0/0
the alternate port which is blocking is 0/1
but for VLAN 20 notice that’s been flip around
this is the root port for VLAN 20
and this is the alternate port for VLAN 20
so blocking for VLAN 20, this port is blocking for VLAN 10.
So if you have IP phones and PCs connected this switch
the result is that VLAN 10 traffic
let’s assume that your PCs will use this uplink
and VLAN 20 which is your phones would use this uplink
the same is going to be true for this switch.
VLAN 20 traffic is going to use this uplink
and VLAN 10 traffic is going to use this uplink.
So switch 4 sh spanning-tree vlan 10
root port is gigabit 0/1, 20, root port is gigabit 0/0
so we have once again been able to implement load sharing of traffic
in the uplinks on this switch as well as this switch.
So Spanning Tree is a lot better now than what it was previously.
So what’s the recommendation?
make sure that you configure your core switches as the root switches
now we can use a command such as sh spanning-tree root on switch 1
to see which ports are root ports.
now there are no root ports on the switch for VLANs 1 and 10
because the switch is the root switch
but notice for VLAN 20 the root port is gigabit 0/0
and the cost to get to the root is 4, this gigabit link has a cost of 4.
On switch 2 sh spanning-tree root
notice for VLAN 1 and 10 its root port is 0/0 with the cost of 4
there is no root port for VLAN 20
the root cost is 0 because the switch is the root switch.
something similar could be seen on our access switches
so sh spanning-tree root on switch 3
the switch over here has gigabit 0/0 as the root port for VLAN 1 and VLAN 10
gigabit 0/1, this port is the root port for VLAN 20
and lastly, on switch 4 something similar can be seen sh span root
root ports for 1 and 10 are gigabit 0/1 over here
root port for VLAN 20 is this port.
We’ve optimized Spanning Tree now a lot better that it was a moment to go.
However, we still have a blocking port here
so we want to optimize that by creating a link aggregation of these 2 ports
and will do that in the next video.