120
By default, the spanning tree feature is disabled globally, enabled on all VLANs, and enabled on all
ports.
To enable or disable the spanning tree feature globally (not for any VLANs), use this command without
specifying any VLAN in system view. To enable or disable the spanning tree feature on specific VLANs,
use this command with the VLANs specified in system view.
Configured in system view, the setting takes effect globally.
Configured in Ethernet interface view, the setting takes effect only on the interface.
Configured in port group view, the setting takes effect on all ports in the port group.
Configured in Layer 2 aggregate interface view, the setting takes effect only on the aggregate interface.
Configured on a member port in an aggregation group, the setting takes effect only after the port leaves
the aggregation group.
When you enable the spanning tree feature, the device works in STP-compatible, RSTP, MSTP, or PVST
mode, depending on the spanning tree mode setting.
When you enable MSTP, the switch dynamically maintains the spanning tree status of VLANs, based on
received configuration BPDUs.
When you disable MSTP, the switch stops maintaining the spanning tree status.
Related commands: stp mode.
Syntax
In system view:
stp [ vlan vlan-list ] enable
undo stp [ vlan vlan-list ] enable
In Ethernet interface, Layer 2 aggregate interface, port group:
stp enable
undo stp enable
View
System view, Ethernet interface view, port group view, Layer 2 aggregate interface view
Default level
2: System level
Parameter
vlan vlan-list: Specifies a VLAN list in the format of vlan-list = { vlan-id [ to vlan-id ] }&<1-10>, where the
vlan-id parameter represents the VLAN ID, in the range of 1 to 4094, and &<1-10> indicates that you can
specify up to 10 VLAN IDs or VLAN ID ranges.
Examples
# In MSTP mode, enable the spanning tree feature globally.
<Sysname> system-view
[Sysname] stp enable
# In PVST mode, enable the spanning tree feature globally and in VLAN 2.
<Sysname> system-view