show spanning-tree interface gigabitethernet 0/2
Switch default

Instance  Role         State        Cost     Prio     type
--------  ----         -----        ----     ----     ----
MST00     Designated   Forwarding   20000    128.2   P2P
MST01     Designated   Forwarding   20000    128.2   P2P
MST02     Designated   Forwarding   20000    128.2   P2P

How the value 128.2 is calculated?


128 is the default port priority (not cost) for xSTP interfaces, and .2 is the port number (eg: gi0/2).

In short, all things being equal (and in their default state), if two switches have multiple links joining them together, the lowest physical port number will generate the lowest port priority, and hence become the preferred root port.

  • Thanks for Info. – kamakshi Feb 22 at 10:17

128 is the default bridge priority. 2 is the port number and its default priority.

STP always chooses the bridge or port with the lowest number = highest priority. Paths to bridges with higher numbers are blocked. Put another way, the bridge with the overall lowest priority number is elected as root bridge. All ports leading to the root bridge are compared by their cost (lowest cost is chosen) and when there's a tie between bridges, the path to the bridge with the lowest priority number is chosen.

When there's a tie between ports (=two ports connecting to the same bridge) the ports' priorities are used.

Note that in both bridge and port priorities, the configured priority is prepended to the bridges MAC address or the port number. So, even with identical configured priorities there can never be a tie between bridges or ports as each hardware number is unique.

  • Is that 128 the default bridge priority or the default port priority? I thought bridge priorities are something like 32768 usually (by default) and go in steps of 4096 or something like that? – ilkkachu Feb 22 at 13:39

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.