Table of Contents

STP / RSTP

getting info

show spanning-tree
show spanning-tree bridge
show spanning-tree detail
show spanning-tree vlan 28

RSTP

show spanning-tree summary
enable
config
spanning-tree mode ?
spanning-tree mode rapid-pvst

spanning-tree vlan 1 priority 57344
spanning-tree vlan 2 priority 57344
spanning-tree vlan 28 priority 57344
spanning-tree vlan 255 priority 57344
end
show spanning-tree bridge
wr

Disable STP:

enable
config terminal
Switch(config)#no spanning-tree vlan 1-2,28,36,255
wr
copy run star

Enable STP trunk on one port:

interface GigabitEthernet1/1
no switchport nonegotiate
switchport mode dynamic auto
end

Inconsistent port type

Port Gi0/48 is an uplink to another switch:

.Aug 19 10:12:00.074: %SPANTREE-7-RECV_1Q_NON_TRUNK: Received 802.1Q BPDU on non trunk GigabitEthernet0/48 VLAN1.
.Aug 19 10:12:00.074: %SPANTREE-7-BLOCK_PORT_TYPE: Blocking GigabitEthernet0/48 on VLAN0001. Inconsistent port type.
.Aug 19 10:12:18.395: %SPANTREE-2-UNBLOCK_CONSIST_PORT: Unblocking GigabitEthernet0/48 on VLAN0001. Port consistency restored.

Setup uplink port as trunk

enable
conf term
interface Gi0/48
spanning-tree portfast trunk
switchport mode trunk

Setup all end-user ports 0-47 as:

enable
conf term
interface range Gi0/1-47
no switchport mode trunk
spanning-tree portfast
# optional
# don't expect bpdu packets - but it can create loops in LAN!
spanning-tree bpdufilter enable
spanning-tree bpduguard disable