Hello I am new at networking and studying for CCNA.

There is a paragraph like this in the book and I am struggling about understanding well. Maybe it's because english is not my native language.

spanning-tree vlan x root primary (on the switch that should be primary)

spanning-tree vlan x root secondary (on the switch that should be secondary)

These two commands cause the switch to make a choice of priority value but then store the chosen priority value in the spanning-tree vlan x priority value command. The command with root primary or root secondary does not appear in the configuration. When configuring root primary, the switch looks at the priority of the current root switch and chooses either (a) 24,576 or (b) 4096 less than the current root’s priority (if the current root’s priority is 24,576 or less) to the configuration instead. When configuring, root secondary always results in that switch using a priority of 28,672, with the assumption that the value will be less than other switches that use the default of 32,768, and higher than any switch configured as root primary.

Can anyone please explain that paragraph to me? What are the logic of those numbers? It kinda made me confused.

  • The default priority for a switch is 32,768. The root primary sets it to 24,576, and root secondary sets it to 28,672. As @Zac67 points out, you should set it yourself to something much lower.
    – Ron Maupin
    Mar 25 at 12:40

The STP root bridge is selected by the lowest priority value in the tree. If there's a tie, the lower base MAC address is chosen. If the root fails the same selection repeats and the switch with the then-lowest priority value is elected root.

The commands in your question are supposed to simplify the configuration process for an admin (who might not be well versed in STP). One switch is configured to become root and one to become the fall-back root (secondary).

I'd recommend not using these simplified commands but proper priority values directly to have a well-defined root, usually 0 or 4096 (priority values are multiples of 4096=212 generally). Using those simplified commands, it's possible that you auto configure a root today (starting with default 8 * 4096 = 32,768 that'd be 6 * 4096 = 24,576), but when another switch is added later with a configured lower priority value it would take over the root - intended or not.

Having an unexpected root bridge on the edge of your network can have surprising effects on your flows, which might be hard to diagnose if STP is not on your radar. I'd also seriously recommend securing untrusted edge ports using options like root-guard and tcn-guard, depending on your equipment.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.