Transcription of Spanning Tree Commands - Cisco
1 SpanningTree Commands Spanning -treebpdu (Global), on page 2 Spanning -treeforward-time, on page 3 Spanning -treehello-time, on page 4 Spanning -treeloopback-guard, on page 5 Spanning -treemax-age, on page 6 Spanning -treemode, on page 7 Spanning -treemst configuration, on page 8 Spanning -treemst max-hops, on page 9 Spanning -treemst port-priority, on page 10 Spanning -treepathcostmethod, on page 11 Spanning -treepriority, on page 12 Spanning -treeenable, on page 13 Spanning -treebpdu (Interface), on page 14 Spanning -treebpduguard, on page 15 Spanning -treecost, on page 16 Spanning -treeguardroot, on page 17 Spanning -treelink-type, on page 18 Spanning -treeport-priority, on page 19 Spanning -treeportfast, on page 20 showspanning- tree , on page 21 showswitchspanning- tree , on page 22 SpanningTree Commands1spanning-treebpdu(Global)To defineBridgeProtocolData Unit (BPDU)
2 Handlingwhenthe spanningtree is disabledgloballyor on asingleinterface,use thespanning-treebpducommandin restorethe defaultconfiguration,use thenoform of this {filtering|flooding}nospanning-treebpduS yntaxDescriptionSpecifiesthat BPDU packetsare filteredwhenthe spanningtree is disabledon an untaggedBPDU packetsare floodedunconditionally(withoutapplyingVL AN rules)to all ports wherespanningtree is disabledand the BPDU handlingmodeis defaultsettingis (config-switch)CommandHistoryModificatio nReleaseThis commandwas filteringand floodingmodesare relevantwhenthe spanningtree is disabledgloballyor on a followingexamplesets the BPDU packethandlingmodeto floodingwhenthe spanningtree isdisabledon an interface.
3 Nfvis(config-switch)# Spanning -treebpdufl oodingnfvis(config-switch)#commitnfvis(c onfig-switch)#endSpanningTree Commands2 SpanningTree Commandsspanning-treebpdu(Global)spannin g-treeforward-timeTo configurethe Spanning -treebridgeforwardtime, whichis the amountof time a port remainsin the listeningand learningstatesbeforeenteringthe forwardingstate,use restorethe defaultconfiguration,use thenoform of this Spanning -treeforwardtime in rangeis from 4 to secondsCommandModesSwitchconfiguration(c onfig-switch)CommandHistoryModificationR eleaseThis commandwas forwardingtime,the followingrelationshipshouldbe maintained:2 * (Forward-Time - 1) >= Max-Age>= 2 * (Hello-Time + 1)ExampleThe followingexampleconfiguresthe spanningtree bridgeforwardingtime to 25 seconds.
4 Nfvis(config-switch)# Spanning -treeforwar d-time25nfvis(config-switch)#commitnfvis (config-switch)#endSpanningTree Commands3 SpanningTree Commandsspanning-treeforward-timespannin g-treehello-timeTo configurehow often the devicebroadcastsHellomessagesto other devices,use thespanning- tree hello-timecommandin restorethe defaultconfiguration,use thenoform of this commandspanning-treehello-timesecondsnos panning-treehello-timeSyntaxDescriptionS pecifiesthe Spanning -treeHellotime in from 1 to secondsCommandModesSwitchconfiguration(c onfig-switch)CommandHistoryModificationR eleaseThis commandwas Hellotime,the followingrelationshipshouldbe maintained:Max-Age>= 2*(Hello-Time + 1)ExampleThe followingexampleconfiguresthe Spanning -treebridgehello time to 5 seconds.
5 Nfvis(config-switch)# Spanning -treehello- time5nfvis(config-switch)#commitnfvis(co nfig-switch)#endSpanningTree Commands4 SpanningTree Commandsspanning-treehello-timespanning- treeloopback-guardTo shut downan interfaceif it receivesa loopbackBPDU,use thespanning- tree loopback-guardcommandin returnto the defaultsetting,use thenoform of this commandhas no (config-switch)CommandHistoryModificatio nReleaseThis commandwas enablesshuttingdownall interfacesif a loopbackBPDUis receivedon (config-switch)# Spanning -treeloopback-gu ardnfvis(config-switch)#commitnfvis(conf ig-switch)#endSpanningTree Commands5 SpanningTree Commandsspanning-treeloopback-guardspann ing-treemax-ageTo configurethe STP maximumage, use thespanning- tree max-agecommandin restorethe defaultconfiguration,use thenoform of this Spanning -treebridgemaximumage in rangeis from 6 to 40secondsCommandDefault20 (config-switch)CommandHistoryModificatio nReleaseThis commandwas maximumage, the followingrelationshipsshouldbe maintained.
6 2*(Forward-Time - 1) >= Max-AgeMax-Age>= 2*(Hello-Time + 1)ExampleThe followingexamplesets the Spanning -treebridgemaximumage to 10 (config-switch)# Spanning -treemax-age10nf vis(config-switch)#commitnfvis(config-sw itch)#endSpanningTree Commands6 SpanningTree Commandsspanning-treemax-agespanning-tre emodeTo selectwhichSpanningTree Protocol(STP)protocolto run, use restorethe defaultconfiguration,use thenoform of this {stp|rstp|mst}nospanning-treemodeSyntaxD escriptionSpecifiesthat STP is the RapidSTP is the MultipleSTP is (config-switch)CommandHistoryModificatio nReleaseThis commandwas RSTP mode,the deviceuses STP whenthe neighbordeviceuses MSTP mode,the deviceuses RSTP whenthe neighbordeviceuses RSTP, and uses STP whenthe neighbordeviceuses followingexampleenablesSTP:nfvis(config- switch)# Spanning -treemodestpnfvis(config -switch)#commitnfvis(config-switch)#endE xampleThe followingexampleenablesMST.
7 Nfvis(config-switch)# Spanning -treemodems tnfvis(config-switch)#commitnfvis(config -switch)#endSpanningTree Commands7 SpanningTree Commandsspanning-treemodespanning-treems t configurationUse thespanning-treemstconfigurationcommandt o enableconfiguringan MSTregionby (config-switch)CommandHistoryModificatio nReleaseThis commandwas two or moreswitchesto be in the sameMSTregion,they must containthe sameVLAN mapping,thesameconfigurationrevisionnumb er, and the followingexampleconfiguresan (config-switch)# Spanning -treemst configurationnfvis(config-switch-mst)#in stance1 vlan15nfvis(config-switch-mst)#namemst_t estnfvis(config-switch-mst)#revision2nfv is(config-switch-mst)#commitSpanningTree Commands8 SpanningTree Commandsspanning-treemst configurationspanning-treemst max-hopsUse thespanning-treemstmax-hopscommandto configurethe numberof hops in an MSTregionbeforethe BDPUis discardedand the port informationis aged out.
8 Use the no form of this commandto numberof hops in an MSTregionbeforethe BDPUis rangeisfrom 1 to defaultnumberof hops is (config-switch)CommandHistoryModificatio nReleaseThis commandwas followingexampleconfiguresthe maximumnumberof hops that a packettravelsin an MSTregionbeforeit is discardedto (config-switch)# Spanning -treemst max-hops10nfvis(config-switch)#commitSpa nningTree Commands9 SpanningTree Commandsspanning-treemst max-hopsspanning-treemst port-priorityUse thespanning-treemstport-prioritycommandt o configurethe priorityof a port. Use the no form ofthis commandto restorethe spanningtree instanceID.
9 Valid rangeis from 1 to port priority. Valid rangeis from 0 to 240 in multiplesof defaultport priorityis (config-switch)CommandHistoryModificatio nReleaseThis commandwas priorityvaluemust be a multipleof followingexampleconfiguresthe port priority:nfvis(config-switch)#interfaceg igabitEthernet1/1nfvis(config-switch-if) # Spanning -treemst 1 port-priority96nfvis(config-switch-if)#s panning-treemst 1 cost2nfvis(config-switch-if)#commitSpann ingTree Commands10 SpanningTree Commandsspanning-treemst port-priorityspanning-treepathcostmethod To set the defaultpath cost method,use thespanning-treepathcostmethodin returnto the defaultconfiguration,use thenoform of this {long|short}nospanning-treepathcostmetho dSyntaxDescriptionUse 32-bitbasedvaluesfor defaultport path 16-bitbasedvaluesfor defaultport path cost (config-switch)CommandHistoryModificatio nReleaseThis commandwas commandappliesto all the spanningtree instanceson the switch.
10 If the short methodis selected,the switchcalculatesthe defaultcost as 100. If the long methodis selected,the switchcalculatesthe defaultcost as followingexamplesets the defaultpath cost methodto (config-switch)# Spanning -treepathcostmet hodlongnfvis(config-switch)#commitnfvis( config-switch)#endSpanningTree Commands11 SpanningTree Commandsspanning-treepathcostmethodspann ing-treepriorityTo configurethe deviceSTP priority, whichis used to determinewhichbridgeis selectedas the root bridge,use thespanning-treeprioritycommandin restorethe defaultdevicespanning-treepriority, use thenoform of this commandspanning-treepriorityprioritynosp anning-treeprioritySyntaxDescriptionSpec ifiesthe bridgepriority.