Configure Spanning Tree Port Costs and Switch Priority Commands

Change Root Port

SW1#terminal monitor (if using a telnet or ssh connection )
SW1#debug spanning-tree events
SW1#configure terminal
SW1(config)#interface fa0/2 (or the port of the active trunk )
SW1(config-if)#spanning-tree vlan 3 cost 2
SW1#show spanning-tree vlan 3 ( fa 0/2 became the root port placing fa 0/1 in blocking )

Change Root Bridge

SW1(config)#spanning-tree vlan 3 root primary ( changes the priority value to 24576 + vlan value (3) )
SW1(config)#spanning-tree vlan 3 root secondary ( changes the priority value to 28,672, back up if the root bridge ever goes down)
SW1(config)#spanning-tree vlan vlan-id priority value ( changes the value to whatever specified )