For detailed descriptions of the parameters and features, see the sections STP parameters and STP features.
device# configure terminal
device(config)# protocol spanning-tree pvst
device(config-pvst)# interface ethernet 0/3
device(conf-if-eth-0/3)# no spanning-tree shutdown
device(conf-if-eth-0/3)# spanning-tree link-type point-to-point
device(conf-if-eth-0/3)# spanning-tree priority 64
device(conf-if-eth-0/3)# spanning-tree cost 10000
device(conf-if-eth-0/3)# spanning-tree vlan 10 cost 10000
device(conf-if-eth-0/3)# spanning-tree guard root
Root guard protects the root bridge from malicious attacks and unintentional misconfigurations where a bridge device that is not intended to be the root bridge becomes the root bridge.
device(conf-if-eth-0/3)# spanning-tree port-fast bpdu-guard
device(conf-if-eth-0/3)# spanning-tree port-fast bpdu-filter
device(conf-if-eth-0/3)# exit
device# show spanning-tree brief Spanning-tree Mode: PVST 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/3 DES FWD 200000 64 P2P No
Observe that the settings comply with the formula set out in the STP parameters 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 pvst device(conf-pvst)# interface ethernet 0/3 device(conf-if-eth-0/3)# no spanning-tree shutdown device(conf-if-eth-0/3)# spanning-tree link-type point-to-point device(conf-if-eth-0/3)# spanning-tree priority 64 device(conf-if-eth-0/3)# spanning-tree cost 10000 device(conf-if-eth-0/3)# spanning-tree vlan 10 cost 10000 device(conf-if-eth-0/3)# spanning-tree guard root device(conf-if-eth-0/3)# spanning-tree port-fast bpdu-guard device(conf-if-eth-0/3)# exit device# show spanning-tree device# copy running-config startup-config