Follow these steps to enable or disable STP and configure STP parameters.
You can enable STP or STP with one or more parameters enabled.
For detailed descriptions of the parameters and features, see the sections STP parameters and STP features.
device# configure terminal
device(config)# protocol spanning-tree stp
device(config-stp)# description stp1
device(config-stp)# bridge-priority 4096
device(config-stp)# forward-delay 20
device(config-stp)# max-age 25
device(config-stp)# hello-time 8
device(config-stp)# error-disable-timeout enable
device(config-stp)# error-disable-timeout interval 60
device(config-stp)# port-channel path-cost custom
device(config-stp)# end
device# show spanning-tree brief Spanning-tree Mode: Spanning Tree Protocol Root ID Priority 4096 Address 768e.f805.5800 Hello Time 8, Max Age 25, Forward Delay 20 Bridge ID Priority 4096 Address 768e.f805.5800 Hello Time 8, Max Age 25, Forward Delay 20 Interface Role Sts Cost Prio Link-type Edge ------------------------------------------------------------ Eth 0/2 DES FWD 2000 128 P2P No Eth 0/20 DIS DIS 20000000 128 P2P No Eth 0/25 DIS DIS 20000000 128 P2P No Eth 0/30 DIS DIS 20000000 128 P2P No Eth 0/31 DIS DIS 2000000 128 P2P No
Observe that the settings comply with the formula set out in the STP parameter configuration section, as:
(2 × (forward delay - 1)) ≥ maximum age ≥ (2 × (hello time + 1))
Or in this case
38 ≥ 25 ≥ 18
.
device# copy running-config startup-config
device# configure terminal device(config)# protocol spanning-tree stp device(config-stp)# description stpForInterface device(config-stp)# bridge-priority 4096 device(config-stp)# forward-delay 20 device(config-stp)# max-age 25 device(config-stp)# hello-time 8 device(config-stp)# error-disable-timeout enable device(config-stp)# error-disable-timeout interval 60 device(config-stp)# port-channel path-cost custom device(config-stp)# end device# show spanning-tree brief device# copy running-config startup-config