VLANGlobal Config

vlan [vlan-id]

Creates a VLAN on a Cisco switch and enters VLAN configuration mode to assign a name or other parameters.

Syntax·Global Config
vlan [vlan-id]

When to Use This Command

  • Segmenting a network into separate broadcast domains for security or traffic management.
  • Creating a native VLAN for trunk ports to carry untagged traffic.
  • Setting up a management VLAN for remote switch administration.
  • Isolating guest Wi-Fi traffic from corporate data traffic.

Command Examples

Create VLAN 10 and assign a name

Switch(config)# vlan 10 Switch(config-vlan)# name Sales
Switch(config)# vlan 10
Switch(config-vlan)# name Sales
Switch(config-vlan)# end
Switch# show vlan brief

VLAN Name                             Status    Ports
---- -------------------------------- --------- -------------------------------
1    default                          active    Fa0/1, Fa0/2, Fa0/3, Fa0/4
10   Sales                            active    
1002 fddi-default                     act/unsup 
1003 token-ring-default               act/unsup 
1004 fddinet-default                  act/unsup 
1005 trnet-default                    act/unsup

The 'vlan 10' command creates VLAN 10 and enters VLAN configuration mode. 'name Sales' assigns a descriptive name. 'end' returns to privileged EXEC mode. 'show vlan brief' displays all VLANs; VLAN 10 now appears with name 'Sales' and status 'active' (no ports assigned yet).

Create VLAN 20 without a name

Switch(config)# vlan 20
Switch(config)# vlan 20
Switch(config-vlan)# end
Switch# show vlan id 20

VLAN ID: 20
VLAN Name: VLAN0020
VLAN Type: Ethernet
VLAN State: active
MTU: 1500
...

Creating VLAN 20 without a name results in a default name 'VLAN0020'. The 'show vlan id 20' command displays details: VLAN ID, name, type, state, and MTU.

Understanding the Output

The 'show vlan brief' output lists all VLANs with their ID, name, status, and assigned ports. 'Status' shows 'active' for operational VLANs; 'act/unsup' for default VLANs that are active but unsupported on the platform. Ports column lists interfaces in that VLAN; empty means no ports assigned. 'show vlan id X' gives detailed info: VLAN ID, name, type (Ethernet, FDDI, etc.), state (active or suspended), MTU, and other parameters. A healthy VLAN has 'active' state and correct MTU (1500 for Ethernet). Watch for 'suspended' state if VLAN is shut down or misconfigured.

CCNA Exam Tips

1.

CCNA exam tip: VLANs must be created before assigning them to switch ports; otherwise, the port will be in an error-disabled state.

2.

CCNA exam tip: The 'vlan' command is executed in global config mode, not interface mode.

3.

CCNA exam tip: VLAN 1 is the default VLAN and cannot be deleted; it is used for management by default.

4.

CCNA exam tip: To delete a VLAN, use 'no vlan <vlan-id>'; this removes the VLAN and all ports assigned to it become inactive.

Common Mistakes

Mistake 1: Forgetting to create the VLAN before assigning it to a port, causing the port to be in an error-disabled state.

Mistake 2: Using 'vlan' in interface configuration mode instead of global config mode.

Mistake 3: Deleting a VLAN that has active ports, which shuts down those ports and can cause network outages.

Related Commands

Practice for the CCNA 200-301

Test your knowledge with hundreds of CCNA practice questions covering all exam domains.

Practice CCNA Questions