NetOps Toolkit

Cisco IOS

VLAN Config Generator

Generate pasteable VLAN, trunk, and inter-VLAN routing configs

What is a VLAN?

A VLAN (Virtual Local Area Network) is a logical segmentation of a physical network at Layer 2. Devices in the same VLAN communicate as if on the same physical switch, regardless of location. Traffic between VLANs requires a Layer 3 device to route between them.

  • Broadcast domain reduction — limits scope of broadcast traffic, reducing unnecessary load
  • Security isolation — separates management, voice, and sensitive traffic from user traffic
  • Flexibility — group users by function, not physical location
  • Simplified management — move users between segments by reassigning VLAN, not rewiring

VLAN Types

TypePurposeNotes
DataRegular user traffic (PCs, servers)One per logical group; most common type
ManagementSSH, SNMP, syslog, switch adminAlways use a dedicated VLAN — never VLAN 1
NativeUntagged 802.1Q trunk trafficDefault is VLAN 1 — always change to unused VLAN
VoiceIP phone traffic with higher QoS prioritySeparate from data for consistent voice quality
Default (VLAN 1)All ports start here by defaultCannot be deleted or renamed — never use for traffic
Black HoleUnused VLAN for inactive/unused portsSecurity best practice — shut down ports assigned here

802.1Q Tagging

IEEE 802.1Q is the industry standard for VLAN tagging. A 4-byte tag is inserted into the Ethernet frame between the source MAC address and the EtherType field when the frame crosses a trunk link.

TPID
0x8100
Tag Size
4 bytes
PCP (QoS)
3 bits (0–7)
DEI
1 bit
VLAN ID
12 bits
Usable IDs
1 – 4094
Native VLAN: Frames on the native VLAN cross a trunk without a tag. Both ends must agree, or STP issues and VLAN hopping attacks can occur. Always change native from VLAN 1.

VLAN ID Ranges

RangeVLANsNotes
IEEE Reserved0, 4095Cannot be assigned or used
Default VLAN1Default for all ports; cannot be deleted or renamed
Normal Range1 – 1005Stored in flash:/vlan.dat; all VTP modes
Legacy Reserved1002 – 1005Token Ring/FDDI; avoid
Extended Range1006 – 4094VTP transparent/off required; stored in running-config

802.1Q vs ISL Trunking

Feature802.1QISL (Legacy)
StandardIEEE open standardCisco proprietary
Encapsulation4-byte tag inserted in frame26-byte header + 4-byte trailer wrap
Native VLANSupported (untagged)Not supported
Status Current standard — always use Deprecated — avoid
IOS Commandencapsulation dot1qencapsulation isl

VTP (VLAN Trunking Protocol)

Cisco-proprietary protocol that propagates VLAN database changes between switches. Convenient but dangerous — a single misconfigured switch can wipe all VLANs from your entire network.

ModeCreates VLANsPropagatesStores DBRecommended
Server Yes Yesflash:/vlan.datUse carefully
Client No ForwardsRAM onlyAccess layer
Transparent Local only Forwardsrunning-config Preferred
Off Local only Norunning-config Most secure
VTP Revision Risk: Connecting a switch with a higher revision number overwrites the entire VLAN DB on every switch in the domain instantly. Always reset by running vtp mode transparent then back to vtp mode server before adding any new switch.

VLAN Best Practices

  • Never use VLAN 1 for user, management, or voice traffic
  • Change native VLAN to an unused ID on all trunks; prevents VLAN hopping
  • Always explicitly set switchport trunk allowed vlan — never allow all VLANs implicitly
  • Hard-set switchport mode access or trunk; disable DTP with switchport nonegotiate
  • Assign unused ports to a black hole VLAN and issue shutdown
  • Use VTP transparent or off mode for safe, predictable VLAN management
  • Document your numbering scheme (e.g., 10=DATA, 20=OPS, 30=VOICE, 40=SECURITY, 99=MANAGEMENT)

Key VLAN Show Commands

CommandPurpose
show vlan briefVLAN ID, name, status, and assigned access ports
show vlan id <id>Full detail for a single VLAN
show interfaces trunkAll trunks: encap, native VLAN, allowed/active VLANs
show interfaces <intf> switchportFull switchport detail: mode, VLANs, DTP state
show mac address-table vlan <id>MAC table filtered to one VLAN
show vtp statusVTP domain, mode, version, revision number
show vtp countersVTP advertisements sent/received