Spanning Tree Command List
By default, spanning tree is enabled on all Cisco switches. Creating an additional VLAN automatically runs another instance of the spanning tree protocol. Spanning tree configuration consists of the following tasks:
- Modifying the spanning tree mode if a mode other than PVST+ is desired.
- Changing the bridge priority to control which switch becomes the root bridge.
- Designating edge ports (ports with no attached switches).
- For PVST+, configuring UplinkFast if desired.
The following table lists commands you would use to configure spanning tree:
Command | Function |
Switch(config)#spanning-tree mode pvst|rapid-pvst|mst | Sets the spanning tree mode. |
Switch(config)#spanning-tree vlan <1-4094> root primary | Forces the switch to be the root of the spanning tree.
|
Switch(config)#spanning-tree vlan <1-4094> priority <0-61440> | Manually sets the bridge priority number.
|
Switch(config-if)#spanning-tree portfast | Enables PortFast on the interface. When the PortFast feature is enabled, the interface changes directly from a blocking state to a forwarding state without making the intermediate spanning-tree state changes. Note: This command is for an edge-type interface. Configuring PortFast on interfaces connected to hubs, concentrators, switches, and bridges can cause temporary bridging loops. |
Switch(config)#spanning-tree uplinkfast | Enables UplinkFast to accelerate the choice of a new root port when a link or switch fails or when the spanning tree reconfigures itself. Note: When you configure rapid spanning tree, disable UplinkFast. Similar functionality is built into rapid spanning tree. |
Switch(config)#no spanning-tree vlan <1-4094> | Disables spanning tree on the selected VLAN. |
Switch#show spanning-tree | Show spanning tree configuration information including the following:
To verify that spanning tree is working, look for an entry similar to the following for each VLAN: Spanning tree enabled protocol ieee |
Switch#show spanning-tree vlan <1-4094> root | Show information about the root bridge for a specific VLAN. Information shown includes:
|
Switch#show spanning-tree vlan <1-4094> bridge | Show spanning tree configuration information about the local switch for the specified VLAN. Information includes the local bridge ID, including the priority and MAC address. |
Examples
The following commands set the bridge priority for a VLAN and enables PortFast on two ports:
Switch(config)#spanning-tree vlan 20 priority 4096
Switch(config)#int fa0/12
Switch(config-if)#spanning-tree portfast
Switch(config-if)#int fa0/13
Switch(config-if)#spanning-tree portfast
The following commands enable Rapid PVST+ for the switch, sets the bridge priority to a higher value than the default, and disables UplinkFast:
Switch(config)#spanning-tree mode rapid-pvst
Switch(config)#spanning-tree vlan 1 priority 36864
Switch(config)#no spanning-tree uplinkfast
Note: When switching from PVST+ to Rapid PVST+, PortFast designations can still be used.
Tidak ada komentar:
Posting Komentar