Courseiva
Spanning TreeMST Config

instance [id] vlan [range]

Creates or modifies an MST instance and maps VLANs to it, enabling per-instance spanning tree behavior in MSTP.

Definition: instance [id] vlan [range] is a Cisco IOS mst config command. Creates or modifies an MST instance and maps VLANs to it, enabling per-instance spanning tree behavior in MSTP.

Overview

The `instance [id] vlan [range]` command in MST configuration mode is a fundamental tool for Multiple Spanning Tree Protocol (MSTP) configuration on Cisco IOS devices. MSTP, defined in IEEE 802.1s, extends Rapid Spanning Tree Protocol (RSTP) by allowing multiple spanning tree instances, each with its own independent topology, to run over a single physical network. This command creates or modifies an MST instance (identified by an instance ID) and maps a range of VLANs to that instance.

The primary purpose is to enable per-instance spanning tree behavior, which optimizes load balancing across redundant links while maintaining loop-free topologies. In MSTP, VLANs are grouped into instances, and each instance runs its own spanning tree algorithm, allowing different VLANs to use different paths. This is particularly useful in large Layer 2 networks where you want to utilize multiple uplinks without blocking ports unnecessarily.

Without MSTP, you would rely on Per-VLAN Spanning Tree (PVST+) or Rapid PVST+, which create a separate spanning tree instance per VLAN, consuming more CPU and memory resources. MSTP reduces overhead by aggregating VLANs into fewer instances. The `instance [id] vlan [range]` command is essential when you need to assign VLANs to specific MST instances to control traffic flow.

For example, you might map odd-numbered VLANs to instance 1 and even-numbered VLANs to instance 2, allowing each instance to use a different root bridge and path. This command is typically used in a multi-switch environment where you want to balance traffic across multiple links. It fits into the broader configuration workflow after enabling MSTP globally with `spanning-tree mode mst` and entering MST configuration mode via `spanning-tree mst configuration`.

Important IOS behavior: The command modifies the MST configuration, which is stored in the running configuration and can be saved to startup-config. Changes take effect immediately but may cause a topology change if VLAN mappings are altered. The MST configuration is a single block; entering MST configuration mode locks the configuration, and you must exit with `exit` or `end` to apply changes.

The command is available in privileged EXEC mode (config-mst). There is no buffered output; the command executes silently. Privilege level 15 is required.

The impact on running config is that the MST instance and VLAN mapping are added or modified. If you map a VLAN that is already mapped to another instance, the previous mapping is overwritten. Common mistakes include using an instance ID outside the valid range (0-4094, but instance 0 is reserved for the Internal Spanning Tree (IST) and cannot be modified), or specifying a VLAN range that overlaps with existing mappings without intending to.

Also, forgetting to exit MST configuration mode to apply changes is a frequent pitfall. Understanding this command is critical for CCNA and CCNP candidates as MSTP is a key topic in the curriculum, and this command is the primary method for configuring MST instances.

Syntax·MST Config
instance [id] vlan [range]

When to Use This Command

  • Load balancing traffic across multiple uplinks by assigning different VLANs to different MST instances.
  • Reducing CPU and bandwidth overhead by grouping multiple VLANs under a single spanning tree instance.
  • Isolating STP topology changes to a subset of VLANs to improve network stability.
  • Implementing a redundant Layer 2 design with multiple MST instances for failover granularity.

Parameters

ParameterSyntaxDescription
id<0-4094>The MST instance identifier. Valid values are from 0 to 4094. Instance 0 is reserved for the Internal Spanning Tree (IST) and cannot be created or modified; it automatically includes all VLANs not explicitly mapped to other instances. Common practice is to use instance IDs starting from 1. Ensure the ID does not conflict with existing instances.
range<1-4094> or range like 1-100, 200, 300-400The VLAN or range of VLANs to map to the specified MST instance. VLAN IDs range from 1 to 4094 (excluding 0 and 4095). You can specify a single VLAN, a hyphenated range (e.g., 10-20), or a comma-separated list (e.g., 10,20,30). All specified VLANs are assigned to the instance. If a VLAN is already mapped to another instance, the mapping is overwritten. Common mistake: using VLAN 0 or 4095, which are invalid.

Command Examples

Map VLANs 10-20 to MST instance 1

instance 1 vlan 10-20

No output is generated on success. The command silently maps VLANs 10 through 20 to MST instance 1. Use 'show spanning-tree mst configuration' to verify.

Map VLANs 30,40,50 to MST instance 2

instance 2 vlan 30,40,50

Maps VLANs 30, 40, and 50 to MST instance 2. VLANs can be specified as a list separated by commas.

Understanding the Output

This command produces no direct output. To verify the mapping, use 'show spanning-tree mst configuration'. The output displays the MST region configuration, including instance-to-VLAN mappings.

Each instance is listed with its ID and the VLANs assigned. Ensure that VLANs are not mapped to multiple instances; overlapping VLANs cause errors. Also verify that all VLANs used in the network are mapped to some instance (default instance 0 handles unmapped VLANs).

Configuration Scenarios

Map VLANs 10-20 to MST Instance 1 for Load Balancing

In a campus network with two distribution switches and multiple access switches, you want to load balance traffic across two uplinks. By mapping VLANs 10-20 to MST instance 1, you can configure a different root bridge for instance 1 than for the default instance 0, allowing some VLANs to use one uplink and others the other.

Topology

SW1(Gi0/1)---trunk---(Gi0/1)SW2 SW1(Gi0/2)---trunk---(Gi0/2)SW2 Access switches connect to both SW1 and SW2

Steps

  1. 1.Step 1: Enter global configuration mode: configure terminal
  2. 2.Step 2: Enable MSTP: spanning-tree mode mst
  3. 3.Step 3: Enter MST configuration mode: spanning-tree mst configuration
  4. 4.Step 4: Create instance 1 and map VLANs 10-20: instance 1 vlan 10-20
  5. 5.Step 5: Exit MST configuration mode: exit
  6. 6.Step 6: (Optional) Set root bridge for instance 1 on SW1: spanning-tree mst 1 root primary
  7. 7.Step 7: Verify configuration: show spanning-tree mst configuration
Configuration
!
spanning-tree mode mst
!
spanning-tree mst configuration
 instance 1 vlan 10-20
 exit
!
spanning-tree mst 1 root primary
!

Verify: Use 'show spanning-tree mst configuration' to display the MST configuration. Expected output includes 'MST instance 1' with 'Vlans mapped: 10-20'. Also use 'show spanning-tree mst 1' to see the spanning tree topology for instance 1.

Watch out: If you forget to exit MST configuration mode, the changes are not applied. Always exit with 'exit' or 'end'.

Map Multiple VLAN Ranges to Different MST Instances

In a data center with multiple VLANs for different departments (Sales: VLANs 100-120, Engineering: VLANs 200-220, Management: VLAN 10), you want each department's traffic to use a different spanning tree instance for optimal path utilization. You will map each range to a separate instance.

Topology

CoreSW1---trunk---CoreSW2 Access switches connect to both core switches

Steps

  1. 1.Step 1: Enter global configuration mode: configure terminal
  2. 2.Step 2: Enable MSTP: spanning-tree mode mst
  3. 3.Step 3: Enter MST configuration mode: spanning-tree mst configuration
  4. 4.Step 4: Map Sales VLANs to instance 1: instance 1 vlan 100-120
  5. 5.Step 5: Map Engineering VLANs to instance 2: instance 2 vlan 200-220
  6. 6.Step 6: Map Management VLAN to instance 3: instance 3 vlan 10
  7. 7.Step 7: Exit MST configuration mode: exit
  8. 8.Step 8: Verify configuration: show spanning-tree mst configuration
Configuration
!
spanning-tree mode mst
!
spanning-tree mst configuration
 instance 1 vlan 100-120
 instance 2 vlan 200-220
 instance 3 vlan 10
 exit
!

Verify: Use 'show spanning-tree mst configuration' to verify all instances and their mapped VLANs. Expected output shows three instances with correct VLAN mappings. Also use 'show spanning-tree mst' to see a summary of all instances.

Watch out: Instance 0 (IST) automatically includes all VLANs not explicitly mapped. If you map a VLAN to an instance, it is removed from instance 0. Ensure you don't accidentally leave critical VLANs unmapped, as they will remain in instance 0.

Troubleshooting with This Command

When troubleshooting MSTP issues, the `instance [id] vlan [range]` command itself is not used for diagnosis, but verifying the MST configuration is crucial. The primary show command is `show spanning-tree mst configuration`, which displays the current MST instance-to-VLAN mappings. Healthy output shows each instance with the correct VLAN range and no overlapping mappings.

Problem indicators include missing VLANs (they should be in an instance), duplicate mappings (though IOS prevents this), or an instance with no VLANs (except instance 0). Another key command is `show spanning-tree mst [instance-id]`, which shows the spanning tree state for a specific instance. Focus on the root bridge, port roles (root, designated, alternate, backup), and port states (forwarding, blocking).

Common symptoms that this command helps diagnose include: (1) Traffic for certain VLANs not using the expected path – check if those VLANs are mapped to the correct instance. (2) Unexpected blocking on uplinks – verify that the MST instance's root bridge is set correctly. (3) Inconsistent MST configuration across switches – MST requires the same instance-to-VLAN mapping on all switches in the region; use `show spanning-tree mst configuration` on multiple switches to compare. A step-by-step diagnostic flow: Step 1: Verify MSTP is enabled globally with `show spanning-tree` (look for 'Spanning tree enabled protocol mst'). Step 2: Check MST configuration with `show spanning-tree mst configuration`.

Ensure VLAN mappings are consistent across all switches in the MST region. Step 3: For a specific instance, use `show spanning-tree mst <instance-id>` to see the topology. Look for the root bridge ID – if it's not the expected switch, adjust the root priority.

Step 4: Check port roles – if a port is blocking unexpectedly, verify that it is not a root port or designated port on another switch. Step 5: Correlate with `show vlan brief` to ensure VLANs exist and are active. Step 6: Use `debug spanning-tree mst events` (with caution) to see topology changes.

Correlating with other commands: `show vlan` shows VLAN existence; `show interfaces trunk` shows trunking status; `show spanning-tree vlan <vlan-id>` (if using PVST+) is not applicable in MST mode. In MST mode, use `show spanning-tree mst <instance-id>`. The `instance` command is only for configuration; troubleshooting relies on show commands.

A common mistake is mapping VLANs inconsistently across switches, causing the MST region to be misaligned. Always ensure all switches in the region have identical MST configuration.

CCNA Exam Tips

1.

Remember that MST instance 0 is the default and always exists; VLANs not explicitly mapped belong to instance 0.

2.

The 'instance' command is configured in MST configuration mode, not global config. Enter with 'spanning-tree mst configuration'.

3.

CCNA may test that MST instances must be consistent across all switches in the same MST region.

4.

Know that the range can be a hyphen (e.g., 10-20) or a comma-separated list (e.g., 10,20,30).

Common Mistakes

Mapping the same VLAN to multiple MST instances, which is rejected by IOS.

Forgetting to enter MST configuration mode before using the 'instance' command.

Not applying the configuration with 'exit' or 'abort' to activate the changes.

Assuming the command takes effect immediately without verifying with 'show spanning-tree mst'.

instance [id] vlan [range] vs name [region-name]

Both commands are configured in MST configuration mode and are essential for MSTP operation. They are often confused because they appear together in the same configuration context, but one defines VLAN-to-instance mapping while the other sets the region identifier for MST region membership.

Aspectinstance [id] vlan [range]name [region-name]
PurposeMaps VLANs to an MST instance for per-instance spanning tree.Sets the MST region name for grouping switches.
ScopeApplies per-instance VLAN mapping within the region.Defines the region name globally for the switch.
Effect on MSTP operationDetermines which VLANs belong to which MST instance, affecting topology computation per instance.Determines region membership; switches with same name and revision are in the same region.
Configuration requirementOptional; default instance 0 includes all VLANs.Required for MSTP to form regions; otherwise default name ''.
Default behaviorAll VLANs mapped to instance 0 by default.Default region name is empty string, no revision (0).
Interaction with other commandsWorks with 'instance' and 'vlan' commands; requires 'region' name to be effective across switches.Works with 'revision' command; must match across switches in same region.

Use instance [id] vlan [range] when you need to segment VLAN traffic into different spanning-tree topologies within an MST region.

Use name [region-name] when configuring MSTP to ensure that all switches in the same administrative domain share a consistent region name.

Platform Notes

In IOS-XE (e.g., Catalyst 9000 series), the `instance [id] vlan [range]` command syntax and behavior are identical to classic IOS. The output of `show spanning-tree mst configuration` may have slightly different formatting but contains the same information. In NX-OS (e.g., Nexus switches), MSTP is supported but the configuration is different.

The equivalent command in NX-OS is `spanning-tree mst configuration` followed by `instance <id> vlan <range>`, but NX-OS uses a different CLI hierarchy. For example, on Nexus, you enter `configure terminal`, then `spanning-tree mst configuration`, then `instance 1 vlan 10-20`. The syntax is similar but NX-OS may require additional steps like `feature spanning-tree` to enable MSTP.

On ASA firewalls, MSTP is not supported; ASA uses PVST+ or Rapid PVST+ for spanning tree. In IOS-XR (e.g., ASR 9000), MSTP is not typically used; instead, Ethernet Virtual Private Network (EVPN) or other technologies are employed. IOS-XR does not support the `instance` command in the same context.

Version differences: In IOS 12.x, MSTP was introduced and the command works as described. In IOS 15.x and 16.x, the command remains unchanged. However, in newer IOS-XE versions (16.x+), there may be additional options like `instance <id> vlan <range> name <name>` to assign a name to the instance, but this is not standard.

Always check the specific platform documentation. For CCNA and CCNP studies, the command is consistent across IOS and IOS-XE. On Catalyst 2960, 3560, 3750, and 3850 series, the command works identically.

On Catalyst 4500 and 6500, the same syntax applies. Note that on some older platforms, MSTP may require a specific license or IOS version. Always ensure the switch supports MSTP (most Layer 2 switches do).

The command is not available in IOS-based routers (e.g., ISR) unless they have switch modules. In summary, the command is standard across Cisco IOS and IOS-XE, with minor differences in NX-OS, and not applicable to ASA or IOS-XR.

Practice for the CCNA 200-301

Test your knowledge with practice questions covering all CCNA 200-301 exam domains.

Practice CCNA 200-301 Questions