At the moment in this topology switch 2 is the root
and we can prove that by using sh spanning-tree
and notice the local switch is the root for VLAN 1 in the topology.
No other VLANs have been enabled
so the only Ethernet VLAN existing at the moment is VLAN 1
and all ports are VLAN 1 on all the switches.
When looking at the BPDUs
we can see that the switch is advertising a root path cost of 0
and the bridge ID and root identifier are the same.
On switch 1 when we capture traffic here
it's advertising a root path cost of 4
and you can see that the bridge identifier is different to the root identifier
So on switch 1, let’s change the spanning-tree vlan 1 root
so I'll change the switch to become the root and in this case, it’ll be the primary root
that will drop the priority of the switch.
previously the switch was using a default priority
which we can see in the Wireshark capture
it was 32768 + the VLAN number but now sh spanning-tree
shows us that the switch priority has been reduced
to a value lower than any current root bridge.
So the switches now become the root of the Spanning Tree topology.
Bridge MAC address and root MAC address is the same.
So these are our first Wireshark capture
and if I scroll down to the latest advertisements.
Notice the root path cost is 0.
Bridge ID and root identifier are the same, the priorities have been reduced.
So this switch is root with the lower priority.
You can see that the bridge priority is 24576
extended system ID is 1 bacause this is VLAN 1
and the MAC address of the switch is set to the following.
So once again, if we look at the Wireshark capture
this is capture 114 at the moment.
Previously the root identifier and bridge identifier were different.
Now, what about switch 2 previously this switch was the root.
So notice on capture 1, this switch previously had the root path cost of 0
but scrolling down through the captures
you can now see that it has a root path cost of 4.
Its local bridge identifier has a higher priority.
So this switch is no longer the Spanning Tree root.
Previously on the switch 3, this was the root port.
So here's the output you can see that gigabit 0/0
was the root port on switch 3.
What is it now? So sh spanning-tree
notice gigabit 0/1 is the root port at the moment.
so previously on switch 3 this was the root port
but the root port is now changed to this port
because this switch is now the Spanning Tree root.
the path cost using this link is 4
where's now the path cost using this link would be 4 + 4
in other words 8 to get to the root bridge.
Spanning tree topologies can dynamically change
so as an example, if on switch 3 has shut down gigabit 0/1
and type sh spanning-tree
What we can see now is that gigabit 0/0 is now the root port
as this port is no longer available.
If I no shut that interface and type sh spanning-tree
and see the interface is coming up.
What you can see now is that gigabit 0/1 has become the root port once again
where's this port is now blocking to stop a Spanning Tree loop.