Pcornel
Browse topics
Options
Recent
Favorites
Networking · Technical reference

VLAN · Layer 2 Switch

Direct answer

On a Layer 2 switch, a VLAN is a separate broadcast domain: access ports belong to one VLAN, trunks carry many, and traffic between VLANs needs a router or Layer 3 switch.

When to use this

Use it when a port is in the wrong VLAN or a VLAN is missing.

First 30 seconds

1. VLANs separate broadcast domains.

2. Access ports in one VLAN.

3. VLAN must exist to forward.

4. Keep naming consistent.

5. Avoid VLAN 1 for users.

Operational verification

port → VLAN → broadcast domain

Context & applicabilityCommon mistakes · platform/version boundaries
Platform / version applicability
Cisco IOS / IOS XE
applies
Structured applicability is explicit Topic metadata; it does not infer compatibility beyond the stored rows.
At a glance

Operational reference

Fast context before you go deeper.

PlatformCisco IOS / IOS XE · Cisco IOS XE
Scope / prerequisiteUse it when a port is in the wrong VLAN or a VLAN is missing.
What next?3 suggested next steps
Evidence1
On this pageJump to a specific section
Operational workflow

Verification & Troubleshooting

Start with the observed symptom, prove the nearest boundary, and move outward only when the current state is understood.

5 steps Observe → verify → isolate → change minimally → repeat the original test.
ObservedRecord what the original test actually shows

Capture the concrete output, symptom, packet, log or counter before changing anything.

Step 1 Layered verification Verify boundary

Verify switchport mode, VLAN admission and STP state, then confirm the source/destination MAC learns on the expected logical interface during the original flow.

Step 2 Verification path Verify boundary

Primary bounded procedure: Use show vlan brief for VLAN state and membership, then inspect trunk/switchport state on the actual path.

Exercise one safe negative or boundary case implied by mismatched trunk/native VLAN, inconsistent bundle parameters, blocked/discarding state, root change, MAC instability, partial member failure or err-disable.

For multi-device behavior, enumerate every expected peer, path, route target, member, VLAN, tunnel endpoint, controller node or next hop rather than accepting one healthy instance as closure. Where ECMP or redundancy exists, verify path diversity and failure behavior as well as steady state.

Step 3 Common mistakes Narrow the fault
  • Creating the VLAN on one switch but not on the others in the path.
  • VLAN not allowed on the trunk.
Step 4 Decision tree: first failed boundary Narrow the fault

Concrete boundaries: physical link → switchport mode → access/trunk VLAN admission → allowed/native VLAN → STP state → MAC table → original frame.

Step 5 Where it fails Narrow the fault

Walk physical link → switchport/bundle membership → VLAN/instance state → STP/LAG decision → MAC forwarding → end-to-end frame path and stop where observed state diverges.

Common failure classes are mismatched trunk/native VLAN, inconsistent bundle parameters, blocked/discarding state, root change, MAC instability, partial member failure or err-disable.

Closure requires original-test success plus independent verification that no collateral route, VLAN, peer, tunnel, queue, security policy or redundant path regressed. For VLAN, document the exact failure point and why adjacent layers are excluded. Source-backed expectations remain separate from observed Evidence.

Evidence references

Evidence · 1 on this Topic

Expected observations and documentation recipes are reference material. Record actual output, device identity, scope and time before claiming a verified result.

observation · 1
Command lookup Jump straight to Cisco syntax
Key points
  • VLANs divide a switch into separate broadcast domains.
  • Each VLAN usually maps to one IP subnet.
  • Traffic between VLANs needs a router or Layer 3 switch.
Key checks
  • show vlan brief — VLANs and ports
  • show interfaces <interface> switchport — access VLAN
ReferenceWhat it is1 section · depth on demand

What it is

Layer-2 forwarding depends on physical link state, switchport mode, VLAN admission on the port and the resulting MAC forwarding entry. A trunk can be operational while the required VLAN is pruned, absent or mapped differently. Close with Verify switchport mode, VLAN admission and STP state, then confirm the source/destination MAC learns on the expected logical interface during the original flow. and state what the evidence does not show.

ReferenceWhy it matters1 section · depth on demand

Overview

On a Layer 2 switch, VLANs divide ports into separate broadcast domains. Each VLAN normally maps to one IP subnet; traffic between VLANs needs a Layer 3 device.

Port typeVLAN handling
AccessOne VLAN, untagged
Access + voiceData untagged, voice tagged
TrunkMany VLANs, 802.1Q tagged
show vlan brief
show interfaces switchport

Documented example, not captured output.

Remove unused VLANs from trunks to limit flooding and the reach of spanning-tree problems.

ReferenceImportant terms & boundaries2 sections · depth on demand

In depth

VLANs on a Layer 2 switch

A VLAN splits one switch into separate broadcast domains. Cisco's Catalyst 9000 VLAN guide defines it as a logical grouping that segments a network into smaller broadcast domains, and notes that traffic between VLANs must be routed, through SVIs or an external router.

VLAN ranges (VLAN guide)

RangeIDsNotes
Normal1–1005Stored in vlan.dat in flash; 2–1001 configurable
Reserved1002–1005Token Ring and FDDI; can't be removed
Extended1006–4094Not in the VLAN database unless VTP version 3 is used

VLAN 1 (VLAN guide)

VLAN 1 exists on every switch, can't be deleted or renamed, and carries control traffic such as CDP, STP and VTP. Cisco advises against using it for user data.

SW1(config)# vlan 110
SW1(config-vlan)# name USERS
SW1(config)# vlan 120
SW1(config-vlan)# name VOICE
SW1(config)# interface GigabitEthernet1/0/5
SW1(config-if)# switchport mode access
SW1(config-if)# switchport access vlan 110
SW1(config-if)# switchport voice vlan 120
SW1# show vlan brief
VLAN Name                             Status    Ports
---- -------------------------------- --------- -------------------------------
1    default                          active    Gi1/0/40, Gi1/0/41
110  USERS                            active    Gi1/0/1, Gi1/0/5, Gi1/0/6
120  VOICE                            active    Gi1/0/5, Gi1/0/6
999  PARKING                          active    Gi1/0/2, Gi1/0/3

Behaviour to know (VLAN guide)

PointDetail
Assigning a port to a missing VLANCreates the VLAN
Deleting a VLANIts ports become inactive until reassigned
Default namesVLAN0004 style, zero-padded
VTP server modeVLAN deletion applies across the VTP domain
Extended VLANs with VTP v1/v2Need transparent mode and a saved configuration

Design practice

PracticeReason
One VLAN per function (users, voice, printers, APs, management)Policy and troubleshooting by VLAN
Unused ports in a parking VLAN and shut downNo accidental access
Keep VLANs local to an access block where possibleSmaller failure domains

Documented example, not captured output.

Source basisSource attribution states what this section is based on; it is not independent proof that the current environment matches it.

Mechanics

For Network Devices → Layer 2 Switch → VLAN, stable identity is device + VLAN/instance + interface/port-channel + peer where relevant.

A healthy neighbor, route, VLAN, tunnel or controller object does not by itself show the whole path.

Follow the path in order: physical link → switchport/bundle membership → VLAN/instance state → STP/LAG decision → MAC forwarding → end-to-end frame path.

The durable invariants are: both ends agree on encapsulation/membership; loop-prevention state is intentional; active members are consistent; forwarding follows the selected topology.

Preserve device, VRF, VLAN, interface, address family, process or instance identity; exact prefixes/peers; direction; timestamps; platform/release; and the policy object that acted on traffic.

Important negative cases include mismatched trunk/native VLAN, inconsistent bundle parameters, blocked/discarding state, root change, MAC instability, partial member failure or err-disable.

Source basisSource attribution states what this section is based on; it is not independent proof that the current environment matches it.
ReferenceConfiguration & state1 section · depth on demand

Lifecycle

Record device/platform, interface/VRF/VLAN/process identity, peer or destination scope and rollback point first.

Separate local device state from peer state and from the traffic consumer.

A route can exist without a resolved adjacency; a trunk can be up while the VLAN is absent; a BGP session can be Established while policy suppresses a prefix; a tunnel can be up while underlay or return-path reachability is broken.

Retirement is part of correctness: remove stale peers, routes, VLANs, policies, tunnel bindings, telemetry subscriptions or controller intent only after consumers are detached and alternate paths are verified.

Additional reference context Scope · expected state · examples · history · terminology Open only when you need the supporting context
Technical verification history

Verification history & basis

When and against what this Topic was checked. Later text edits do not count as a new check.

2026-09-14 · vendor docCisco IOS / IOS XE Current documentation reviewed 2026-09-14

Authoritative/upstream documentation reviewed for bounded claims in Network Devices → Layer 2 Switch → VLAN. Documentation verification only; this is not observed lab or production Evidence.

Basis: https://www.cisco.com/c/en/us/support/ios-nx-os-software/ios-xe-17/series.html · confidence 94%
Depth when you need it

Deep reference

Healthy vs suspicious evidence

Output interpretation

Capture device, interface/VRF/VLAN/process/peer identity, address family, platform/release, current state, timers/sequence/age where relevant, counters, policy hits and timestamp.

Confirmation

Confirm action

Continue?