Editing <span id="firstHeadingTitle">Cisco Commands</span> (section)
Read
Edit
View history
Not logged in
Talk
Contributions
Create account
Log in
Editing
Cisco Commands
(section)
Warning:
You are not logged in. Your IP address will be publicly visible if you make any edits. If you
log in
or
create an account
, your edits will be attributed to your username, along with other benefits.
Anti-spam check. Do
not
fill this in!
== Spanning Tree == === Enable PortFast on an interface === Use PortFast on edge/access ports that connect to end devices. interface GigabitEthernet0/1 spanning-tree portfast === Enable PortFast globally === Enables PortFast on all access ports. spanning-tree portfast default === Enable PortFast on a trunk (use with caution) === Only use when the trunk connects to a single end device (not another switch). interface GigabitEthernet0/1 spanning-tree portfast trunk === Verify PortFast status === show spanning-tree interface GigabitEthernet0/1 detail === Disable PortFast on an interface === interface GigabitEthernet0/1 no spanning-tree portfast === Best Practice: Enable BPDU Guard with PortFast === Shuts down the port if a BPDU is received, protecting against loops. Per interface: interface GigabitEthernet0/1 spanning-tree portfast spanning-tree bpduguard enable Globally: spanning-tree portfast default spanning-tree bpduguard default === Set the Root Bridge === The root bridge is the central switch in the spanning tree topology. It is chosen based on the lowest bridge priority. A lower priority value increases the likelihood of a switch becoming the root bridge. Set priority to influence root bridge selection: * The default priority value is **32768** for all switches. * Priority is set in increments of **4096**, and this value is added to the VLAN ID (e.g., for VLAN 1, the default bridge priority would be 32768). To influence the root bridge selection, change the priority value: interface GigabitEthernet0/1 spanning-tree vlan 1 priority 4096 (Sets a lower priority value, increasing the likelihood of this switch becoming the root bridge for VLAN 1) Set the root bridge for a specific VLAN: * To make the current switch the root bridge: spanning-tree vlan 1 root primary (This automatically sets the priority lower than the default value, typically to 24576, to ensure this switch becomes the root bridge) * To make the current switch the backup root bridge: spanning-tree vlan 1 root secondary (This sets the priority higher than the primary root, typically to 28672, making it the backup root bridge) Alternatively, manually set the root bridge priority: interface GigabitEthernet0/1 spanning-tree vlan 1 priority 24576 (Sets this switch with a higher priority, making it more likely to become the root bridge) === Verify Root Bridge === show spanning-tree vlan 1 (Shows the current root bridge and its priority, along with other STP details) === Notes === * Do '''not''' enable PortFast on ports connected to other switches (this can cause network loops). * PortFast should only be used on access/edge ports that connect to end devices like PCs, printers, or phones. * Incorrect use of PortFast can cause Layer 2 loops. * The default priority value is **32768**, and it is adjusted in increments of **4096**. * Lower priority values increase the likelihood of becoming the root bridge. * The priority value combined with the MAC address (if priorities are equal) is used to determine the root bridge.
Summary:
Please note that all contributions to Lucca's Wiki may be edited, altered, or removed by other contributors. If you do not want your writing to be edited mercilessly, then do not submit it here.
You are also promising us that you wrote this yourself, or copied it from a public domain or similar free resource (see
Lucca's Wiki:Copyrights
for details).
Do not submit copyrighted work without permission!
Cancel
Editing help
(opens in new window)
🎨 Theme Settings
Quick Presets
Code & Pre Block Text Color
Code / Pre Text Color
Background
Primary Background
Secondary Background
Tertiary Background
Hover Background
Text
Primary Text
Secondary Text
Muted Text
Accent & Borders
Accent
Accent Dim
Border
Border 2
Header & Sidebar
Header Start
Header End
Sidebar Background
Status Colors
Success
Danger
Warning
Reset to Default
Save & Close