VLAN Configuration and Access Ports
Knowing what a VLAN is earns you a concept; knowing how to create one earns you marks. This lesson turns the theory into IOS commands — creating a VLAN, naming it, and assigning a port to it as an access port — plus the one command that separates voice from data on a single cable.
- Create a VLAN with vlan and name it with name.
- Convert a port to an access port with switchport mode access.
- Assign the port to a VLAN with switchport access vlan.
- Explain that an access port carries exactly one data VLAN (plus a voice VLAN).
- Configure a voice VLAN with switchport voice vlan.
- Verify with show vlan brief and show vlan id.
Step 1 — create and name the VLAN
VLANs are created from global configuration mode with the vlan command. The number enters the normal range unless you specify the extended keyword. A name is optional but strongly recommended — “Students” is much easier to read in a troubleshooting log than “VLAN 10”.
S1# configure terminal S1(config)# vlan 10 S1(config-vlan)# name Students S1(config-vlan)# exit S1(config)# vlan 20 S1(config-vlan)# name Staff S1(config-vlan)# exit
Two details matter for the exam. First, the command is vlan 10 and then
name Students — the name is always a separate command inside the
config-vlan submenu. Second, the VLAN does not actually carry traffic anywhere until you
assign ports: creating VLAN 10 and stopping is an empty shell.
vlan.dat, which lives in flash), not in running-config. That is why
show vlan brief and show running-config tell two different stories, and
why write memory alone may not save a VLAN. The classic mistake is creating the VLAN
and rebooting, only to find it gone.
Step 2 — assign ports as access ports
Now tell the switch which ports belong to which VLAN. The interface is entered, placed in access mode, and joined to the VLAN:
S1(config)# interface gigabitethernet 0/1 S1(config-if)# switchport mode access S1(config-if)# switchport access vlan 10 S1(config-if)# exit S1(config)# interface gigabitethernet 0/2 S1(config-if)# switchport mode access S1(config-if)# switchport access vlan 20 S1(config-if)# end
Three commands, in this exact rhythm, and the port now belongs to the VLAN. The mode
command first makes the port an access port; the access vlan command then says which
VLAN it serves. If you type switchport access vlan 10 without first setting
switchport mode access, IOS may still accept it — but a port that has never been
given the mode access command stays in dynamic desirable/auto trunk negotiation, which is
almost never what you want on a host-facing port.
switchport mode access and switchport access vlan <id> — in
that order. Reversing the order still works in most IOS versions, but the memorised sequence is
mode first, VLAN second.
Step 3 — verify with show commands
Two show commands answer almost every VLAN verification question:
S1# show vlan brief VLAN Name Status Ports ---- -------------------------------- --------- ------------------------------- 1 default active Gi0/3, Gi0/4, Gi0/5, Gi0/6 10 Students active Gi0/1 20 Staff active Gi0/2 1002 fddi-default act/unsup 1003 token-ring-default act/unsup 1004 fddinet-default act/unsup 1005 trnet-default act/unsup
show vlan brief shows the VLAN, its name, its state, and — crucially —
which ports are assigned to it. Note two things: the default untagged ports still sit in VLAN 1, and
VLANs 1002–1005 appear by default in the act/unsup state because the switch does not
support Token Ring or FDDI. show vlan id 10 is the targeted version:
S1# show vlan id 10 VLAN Name Status Ports ---- -------------------------------- --------- ------------------------------- 10 Students active Gi0/1
show vlan brief is your fastest diagnostic. If a PC in VLAN 10
cannot reach its server and show vlan brief lists the server’s port under
VLAN 1, the problem is not routing, not cables, not IP — it is that the
access VLAN was never configured on that interface. Always read the port column before you pull a
cable.
What an access port really is
An access port is a switch port configured to carry exactly one VLAN’s traffic, and it tags nothing. Frames leaving an access port are plain, untagged Ethernet frames — the receiving device (a PC, a printer, an IP phone’s network port) never even sees a VLAN tag and has no idea one exists. If the access port’s VLAN changes, the same physical link suddenly carries a different virtual LAN; the host never notices because none of this appears in Layer 3.
This is the crucial contrast for the syllabus: access ports connect to end devices and carry one untagged VLAN, while trunk ports connect switches together and carry many VLANs, tagging all except the native VLAN. You will configure trunks properly in Lesson 14; the exam wants you to already recognise the dividing line: host-facing access, switch-to-switch trunk.
The voice VLAN on an access port
The configuration that brings the figure to life has two halves. The port must carry the PC’s data VLAN as its access VLAN and announce a separate voice VLAN to the phone. Cisco phones learn which VLAN to use through CDP, which is why CDP must be running on the port (Lesson 16):
S1(config)# interface gigabitethernet 0/1 S1(config-if)# switchport mode access S1(config-if)# switchport access vlan 10 S1(config-if)# switchport voice vlan 20 S1(config-if)# end
switchport voice vlan 20 tells the switch: frames arriving from the phone in the
voice VLAN should be accepted, and the phone should place its own traffic in VLAN 20. The switch
then applies both VLANs to the same access interface: VLAN 10 untagged for the PC<>phone data
path, VLAN 20 for the phone’s audio. Traffic separation remains intact while the cabling stays a
single cable — the phone has a built-in three-port switch that separates PC and phone frames
internally.
switchport voice vlan <id> and lets one physical port serve both a
PC’s data VLAN and the phone’s voice VLAN, keeping the two traffic classes isolated and
letting QoS prioritise the voice.
Access versus trunk at a glance
| Characteristic | Access port | Trunk port |
|---|---|---|
| Connects to | End devices (PC, printer, phone) | Other switches, routers, Layer 3 switches |
| VLANs carried | One (its access VLAN, plus an optional voice VLAN) | Many VLANs, typically all in the native + allowed list |
| Tagging | None — frames leave untagged | Tagged with 802.1Q, except the native VLAN |
| Key commands | switchport mode access, switchport access vlan, switchport voice vlan | switchport mode trunk, switchport trunk native vlan, switchport trunk allowed vlan (Lesson 14) |
Configuration traps and best practice
Three mistakes account for nearly every real-world VLAN misconfiguration, and each one appears in exam scenarios:
- Creating the VLAN but never assigning a port. The VLAN exists, the name is
set, but no interface says
switchport access vlan, so the devices stay in VLAN 1.show vlan briefshows an empty port list. - Assigning the port to a VLAN that does not exist. IOS creates the VLAN
implicitly on most modern switches, which hides the error — but the host ends up in a VLAN
you never intended. Check
show vlan briefafter, not just before. - Forgetting which VLAN is native. On an access port there is no native concept; on a trunk it exists and defaults to VLAN 1. Mixing the two ideas is a favourite distractor (Lesson 14).
switchport mode access before
switchport access vlan, and verify with show vlan brief. Predictable
configuration is reviewable configuration — and the exam rewards reviewable habits.
The vocabulary you need
Every term below appears in the lesson text above. Select one to read its definition, then use the quiz at the end to check what stuck.
Review
Check what you have learned with these review questions.
Sources & references
- Cisco. CCNA (200-301) Exam Topics. cisco.com.
- IETF. Request for Comments (RFCs). rfc-editor.org.
- IANA. Internet Assigned Numbers Authority registries. iana.org.
Target exams: CCNA 200-301 v1.1 · CyberOps Associate 200-201. Last content verification: 2026-10-11.