VLAN Creation and Management
VLANs are a core switching concept used in almost every modern network. In this tutorial, you will learn how to create, name, verify, and delete VLANs using Cisco IOS commands on a Cisco switch, along with understanding where VLAN data is stored and how to clean up the VLAN database correctly.
Before starting this lab, make sure you have completed Basic Interface Configuration and are comfortable with the Cisco IOS mode hierarchy. A solid understanding of network types and LAN concepts will also help you follow the purpose of each step.
What is a VLAN?
A VLAN (Virtual Local Area Network) is a logical segmentation of a switch network that groups devices as if they were on the same physical LAN — regardless of their physical location or which switch port they are connected to. VLANs operate at Layer 2 of the OSI model and are identified by a VLAN ID (1–4094). For conceptual background see VLANs Overview and 802.1Q VLAN Tagging.
| Benefit | How VLANs Achieve It |
|---|---|
| Reduced broadcast traffic | Each VLAN is its own broadcast domain — broadcasts stay within the VLAN and do not flood the entire switch |
| Improved security | Devices in different VLANs cannot communicate directly — traffic must pass through a router or Layer 3 switch. Combine with DHCP Snooping for per-VLAN security enforcement |
| Better performance | Smaller broadcast domains mean less unnecessary traffic reaching every device |
| Simplified management | Users can be grouped by department (SALES, HR, IT) regardless of physical location or floor |
| Flexible design | VLANs can span multiple switches using trunk links |
VLAN ID Ranges
| Range | Description | Usage |
|---|---|---|
1 |
Default VLAN | All ports belong here by default. Cannot be deleted. |
2 – 1001 |
Normal range VLANs | Available for administrator use. Stored in vlan.dat. |
1002 – 1005 |
Legacy reserved VLANs | Reserved for FDDI and Token Ring. Cannot be deleted or modified. |
1006 – 4094 |
Extended range VLANs | Used in large enterprise networks. Requires VTP transparent mode. |
1. Create VLANs
Explanation
By default, all switch ports belong to VLAN 1 (the default VLAN). To logically separate traffic, you must create new VLANs in the switch database. VLAN creation only adds the VLAN to the database — no ports are assigned during this step. Port assignment is covered in the Assigning VLANs to Switch Ports lab.
Creating VLAN 10 and VLAN 20
NetsTuts_SW1>en NetsTuts_SW1#conf t Enter configuration commands, one per line. End with CNTL/Z. NetsTuts_SW1(config)#vlan 10 NetsTuts_SW1(config-vlan)#exit NetsTuts_SW1(config)#vlan 20 NetsTuts_SW1(config-vlan)#end NetsTuts_SW1# %SYS-5-CONFIG_I: Configured from console by console NetsTuts_SW1#wr Building configuration... [OK] NetsTuts_SW1#
(config-vlan)# after entering each VLAN ID.
exit between each VLAN.
You can move directly from one VLAN to the next — IOS stays in VLAN configuration
mode until you type exit or end. For example:
NetsTuts_SW1(config)#vlan 10
NetsTuts_SW1(config-vlan)#vlan 20
NetsTuts_SW1(config-vlan)#end
2. Verify VLAN Configuration
After creating VLANs, always verify using show vlan brief.
This command shows all VLANs in the database, their names, status, and
which ports (if any) are assigned to each.
See Show VLAN for a full command reference.
NetsTuts_SW1#show vlan brief
VLAN Name Status Ports
---- -------------------------------- --------- -------------------------------
1 default active Fa0/1, Fa0/2, Fa0/3, Fa0/4
Fa0/5, Fa0/6, Fa0/7, Fa0/8
Fa0/9, Fa0/10, Fa0/11, Fa0/12
Fa0/13, Fa0/14, Fa0/15, Fa0/16
Fa0/17, Fa0/18, Fa0/19, Fa0/20
Fa0/21, Fa0/22, Fa0/23, Fa0/24
Gig0/1, Gig0/2
10 VLAN0010 active
20 VLAN0020 active
1002 fddi-default active
1003 token-ring-default active
1004 fddinet-default active
1005 trnet-default active
NetsTuts_SW1#
| Column | Meaning |
|---|---|
| VLAN | The VLAN ID number |
| Name | The VLAN name — VLAN0010 is the auto-generated default name (no custom name assigned yet) |
| Status | active = VLAN exists and is ready to use |
| Ports | Switch ports currently assigned to this VLAN. Blank = no ports assigned yet. |
3. Name VLANs
Explanation
Assigning descriptive names to VLANs is a professional best practice.
Names make configurations self-documenting and are especially important
in large enterprise networks where dozens of VLANs may exist.
A VLAN with the name SALES is far easier to identify in
show vlan brief output than one named VLAN0030.
Creating and Naming VLANs 30, 40, and 50 in One Session
NetsTuts_SW1>en NetsTuts_SW1#conf t Enter configuration commands, one per line. End with CNTL/Z. NetsTuts_SW1(config)#vlan 30 NetsTuts_SW1(config-vlan)#name SALES NetsTuts_SW1(config-vlan)#vlan 40 NetsTuts_SW1(config-vlan)#name HR NetsTuts_SW1(config-vlan)#vlan 50 NetsTuts_SW1(config-vlan)#name IT NetsTuts_SW1(config-vlan)#end NetsTuts_SW1# %SYS-5-CONFIG_I: Configured from console by console NetsTuts_SW1#wr Building configuration... [OK] NetsTuts_SW1#
name command must be issued while inside that VLAN's
configuration mode (config-vlan).
4. Verify VLAN Names
Run show vlan brief again to confirm the names were applied correctly.
NetsTuts_SW1#show vlan brief
VLAN Name Status Ports
---- -------------------------------- --------- -------------------------------
1 default active Fa0/1, Fa0/2, Fa0/3, Fa0/4
Fa0/5, Fa0/6, Fa0/7, Fa0/8
Fa0/9, Fa0/10, Fa0/11, Fa0/12
Fa0/13, Fa0/14, Fa0/15, Fa0/16
Fa0/17, Fa0/18, Fa0/19, Fa0/20
Fa0/21, Fa0/22, Fa0/23, Fa0/24
Gig0/1, Gig0/2
30 SALES active
40 HR active
50 IT active
1002 fddi-default active
1003 token-ring-default active
1004 fddinet-default active
1005 trnet-default active
NetsTuts_SW1#
Understanding Legacy VLANs (1002–1005)
Every Cisco switch automatically creates VLANs 1002–1005 in the VLAN database.
You will always see them in show vlan brief output.
Here is what they are and why they exist:
| VLAN ID | Name | Original Purpose | Modern Status |
|---|---|---|---|
1002 |
fddi-default | Reserved for FDDI (Fiber Distributed Data Interface) networks | Obsolete — legacy fiber networking technology |
1003 |
token-ring-default | Reserved for Token Ring networks (IBM, popular in 1980s–1990s) | Obsolete — replaced by Ethernet |
1004 |
fddinet-default | Reserved for FDDI-to-Ethernet translation bridges | Obsolete |
1005 |
trnet-default | Reserved for Token Ring-to-Ethernet translation bridges | Obsolete |
act/unsup (active/unsupported)
means they exist but are not functional on modern Ethernet switches.
Simply ignore them — they have no impact on your configuration.
5. Where Are VLANs Stored? (vlan.dat)
Explanation
VLAN information is stored in a separate database file called vlan.dat, located in the switch's flash memory. This is an important distinction to understand — especially during troubleshooting and factory resets. Flash memory also holds the IOS image — see IOS Upgrade via TFTP for how to manage flash contents.
| Storage Location | Contains | Cleared by erase startup-config? |
|---|---|---|
running-config (RAM) |
Active interface configs, ACLs, routing — but NOT VLANs | N/A — cleared on reload |
startup-config (NVRAM) |
Saved configuration loaded at boot — but NOT VLANs | Yes — erased |
vlan.dat (Flash) |
VLAN IDs and names | ❌ No — persists after erase startup-config and reload |
erase startup-config and
reloading will not remove VLANs. You must separately delete
vlan.dat from flash memory to fully reset VLAN configuration.
Viewing Flash Memory Contents
Use dir flash: or show flash to see what is stored in flash:
NetsTuts_SW1#dir flash:
Directory of flash:/
1 -rw- 4670455 <no date> 2960-lanbasek9-mz.150-2.SE4.bin
2 -rw- 676 <no date> vlan.dat
64016384 bytes total (59345253 bytes free)
NetsTuts_SW1#
dir flash: and show flash — display the same information.
Flash Memory Output Explained
| Field | File 1 (IOS Image) | File 2 (VLAN Database) |
|---|---|---|
| Index | 1 | 2 |
| Permissions | -rw- (read/write) |
-rw- (read/write) |
| File size | 4,670,455 bytes (~4.5 MB) | 676 bytes (very small — just VLAN IDs and names) |
| Filename | 2960-lanbasek9-mz.150-2.SE4.bin — the IOS OS image |
vlan.dat — the VLAN database |
| Date | <no date> — normal on Catalyst 2960; no timestamp stored |
<no date> — same reason |
6. Delete VLANs
Method 1: Delete a Single VLAN
Use the no vlan command from Global Configuration mode to remove
a specific VLAN from the database:
NetsTuts_SW1>en NetsTuts_SW1#conf t Enter configuration commands, one per line. End with CNTL/Z. NetsTuts_SW1(config)#no vlan 10 NetsTuts_SW1(config)#end NetsTuts_SW1#wr Building configuration... [OK] NetsTuts_SW1#
show vlan brief first to
check which ports are assigned to the VLAN you are about to delete.
Method 2: Delete All VLANs (Full Reset)
To completely wipe the VLAN database, delete the vlan.dat file
from flash and reload the switch. This is typically done when repurposing
or factory-resetting a switch.
NetsTuts_SW1#delete flash:vlan.dat Delete filename [vlan.dat]? Delete flash:/vlan.dat? [confirm] NetsTuts_SW1#reload System configuration has been modified. Save? [yes/no]:no Proceed with reload? [confirm]
vlan.dat and reloading removes all custom VLANs.
Answering no to "Save?" is critical — see explanation below.
Why You Must Answer "No" to Save?
| Your Answer | What Happens | Result |
|---|---|---|
| No ✅ | Switch reloads without saving running-config to startup-config | VLANs are gone — vlan.dat was already deleted and not recreated |
| Yes ❌ | Switch saves running-config first, which recreates vlan.dat |
VLANs reappear after reload — your deletion is undone |
Complete VLAN Removal Checklist
For a thorough reset, follow this sequence:
- Check which ports are assigned to each VLAN:
show vlan brief - Reassign or note affected ports before removing VLANs
- Remove VLANs from running-config:
no vlan [number]for each - Save:
write memory - Delete the VLAN database:
delete flash:vlan.dat - Reload the switch:
reload - Answer no when prompted to save
- Verify after reload:
show vlan brief
Key Points & Exam Tips
- All switch ports belong to VLAN 1 by default. VLAN 1 cannot be deleted.
- VLANs are stored in vlan.dat in flash memory — not in running-config or startup-config.
erase startup-configdoes NOT remove VLANs. - The
show vlan briefcommand is your primary verification tool — memorize its columns (VLAN ID, Name, Status, Ports). - A VLAN with no ports in the Ports column is active but has no traffic — ports must be assigned separately using access port configuration.
- VLANs 1002–1005 are reserved legacy VLANs — they cannot be deleted, renamed, or used for your traffic. Ignore them.
- To carry VLAN traffic between switches, a trunk link must be configured — see the Trunk Port Configuration lab. VLANs created on one switch are not automatically known by another switch unless VTP or manual creation is used.
- To completely remove all VLANs: first use
no vlancommands, then deletevlan.dat, reload, and answer no to the save prompt. - Each VLAN is its own broadcast domain. Inter-VLAN communication requires a router (router-on-a-stick) or a Layer 3 switch — see the Inter-VLAN Routing lab. STP runs per-VLAN in Cisco's PVST+ — see Spanning Tree Root Bridge.
- Always name your VLANs — it is a professional best practice and makes large configurations significantly easier to read and troubleshoot.
- Both
dir flash:andshow flashdisplay flash memory contents includingvlan.dat.
An engineer creates VLAN 50 on a switch. Which VLAN ID range is this in, and where will it be stored?
vlan.dat in flash memory — not in running-config or startup-config. This is why erase startup-config does not remove VLANs.An engineer runs erase startup-config and reloads a switch to factory reset it. After reload, show vlan brief still shows VLANs 10, 20, and 30. Why?
erase startup-config only clears NVRAM (startup-config). The VLAN database in vlan.dat is stored separately in flash memory and survives this process. To remove VLANs, you must delete vlan.dat explicitly.A network has 200 devices on a single switch with no VLANs. What is the impact on broadcast traffic compared to a properly segmented VLAN design?
After running show vlan brief, VLAN 40 shows "active" but the Ports column is empty. What does this mean?
Why are VLANs 1002–1005 always present in show vlan brief output on a Cisco switch?
An engineer is in (config-vlan)# mode for VLAN 30. What is the correct command to name it "SALES"?
name command is used in VLAN configuration mode (config-vlan) to assign a descriptive name. description is used on interfaces, not VLANs. vlan-name and set name are not valid IOS commands.An engineer deletes vlan.dat and then answers "yes" when the switch asks "Save? [yes/no]:" before reloading. What will happen after the reload?
vlan.dat. The deletion is undone. You must answer no to preserve the deletion.An engineer deletes VLAN 20 using no vlan 20 without first reassigning the ports. What happens to ports that were in VLAN 20?
show vlan brief and reassign ports before deleting a VLAN.What is the correct complete sequence to fully remove all custom VLANs from a switch?
no vlan commands, (2) save with write memory, (3) delete vlan.dat from flash, (4) reload, (5) answer no to the save prompt. Skipping any step risks VLANs reappearing.