Short answer: an access port carries one VLAN untagged, a trunk carries many VLANs with 802.1Q tags
An access port belongs to one VLAN and passes frames untagged, so the attached device never needs to know about VLANs. A trunk port adds an 802.1Q tag (the VLAN number) to each frame and carries many VLANs over one link. Even on a trunk, the native VLAN travels untagged.
Side by side
- Access port — one VLAN · untagged frames · PCs, printers, single-VLAN servers · if the device sends tagged frames, traffic fails
- Trunk port — every VLAN in its allowed list · 802.1Q tags (none for the native VLAN) · switch-to-switch links, hypervisors, routers · a VLAN missing from the list is dropped with no warning
How it actually works
interface GigabitEthernet1/0/12
switchport mode access
switchport access vlan 20
interface GigabitEthernet1/0/48
switchport mode trunk
switchport trunk allowed vlan 10,20,30
switch# show vlan brief | include servers
20 servers active Gi1/0/12
switch# show interfaces trunk
Port Mode Encapsulation Status Native vlan
Gi1/0/48 on 802.1q trunking 1
Port Vlans allowed on trunk
Gi1/0/48 10,20,30
Trunk ports do not appear in show vlan brief. In the Mode column, on is a static trunk; auto or desirable means DTP negotiated it.
A port with no fixed mode negotiates with DTP. dynamic desirable asks for a trunk; dynamic auto becomes a trunk only when the other side asks (two auto ports stay access). Defaults vary by platform, so set the mode explicitly and turn DTP off with switchport nonegotiate. For IP phones, add a voice VLAN to an access port (switchport voice vlan 150).
When to use which
- PCs, printers, single-VLAN servers → access.
- Uplinks between switches → trunk, allowing only the VLANs you need.
- Hypervisors whose VMs use several VLANs → trunk; set VLAN IDs on the port group or bridge.
- Gateways for several VLANs on one router port → trunk (router on a stick).
Failure 1: a hypervisor on an access port, and only the VMs fail
The host's management IP (VLAN 20) works, but VMs in VLAN 10 and 30 do not. It is an access port, so the VMs' tagged frames do not get through.
$ sudo tcpdump -e -nn -i eno1 vlan
12:04:51.208113 52:54:00:3a:1c:07 > ff:ff:ff:ff:ff:ff, ethertype 802.1Q (0x8100), length 46: vlan 10, p 0, ethertype ARP (0x0806), Request who-has 10.10.10.1 tell 10.10.10.21, length 28
ARP requests tagged vlan 10 repeat with no reply. Make the port a trunk that allows the VM VLANs; if host management traffic leaves untagged, make VLAN 20 the native VLAN.
Failure 2: adding one VLAN cut off all the others
The moment someone types switchport trunk allowed vlan 40 to add VLAN 40, VLANs 10, 20 and 30 go down. Without add, the whole list is replaced.
switch# show interfaces trunk | begin allowed
Port Vlans allowed on trunk
Gi1/0/48 40
Restore it with switchport trunk allowed vlan add 10,20,30. Conversely, a new VLAN never added to the list is the only one that fails to cross.
Failure 3: only one side is a trunk, or a trunk you never wanted
If one end is a trunk and the other is access, only untagged frames get through, so a single VLAN works. A user port left in a dynamic mode can become a trunk via DTP.
sw-access# show interfaces gi1/0/48 switchport
Administrative Mode: static access
Operational Mode: static access
sw-core# show interfaces trunk
Port Mode Encapsulation Status Native vlan
Gi1/0/24 on 802.1q trunking 1
Gi1/0/7 auto 802.1q trunking 1
- User port Gi1/0/7 is trunking in
automode, so DTP built that trunk. Fix it withswitchport mode access - If both ends are trunks and only the native VLAN differs, it is a native VLAN mismatch
What not to do
- Leaving user ports in a dynamic mode — plug in a switch set to trunk or desirable and the port becomes a trunk to every VLAN.
Summary
- One VLAN on the far device → access; several VLANs told apart by tags → trunk
- Read Operational Mode in
show interfaces switchport; for trunks, compare the allowed lists inshow interfaces trunkon both ends - On servers, check tags with
tcpdump -e - Set the mode explicitly and turn DTP off with
switchport nonegotiate
To practise traffic failing only across a trunk, try A trunk link comes up and one VLAN still fails.
Quick diagnostic checklist
- Use Operational Mode in
show interfaces switchportto see whether the port really runs as access or trunk. - Trunk ports do not show up in
show vlan brief; useshow interfaces trunkinstead. - Check that the failing VLAN is in Vlans allowed on trunk on both ends and that the Native vlan matches.
- Add VLANs with
switchport trunk allowed vlan addso the list is not replaced. - Make sure a hypervisor port whose VMs use several VLANs is not configured as access.
- On the server, run
tcpdump -e -nn -i eno1 vlanto see whether frames arrive tagged. - A user port trunking in
autoordesirablemode is a trunk built by DTP. - Set
switchport mode accessortrunkexplicitly and disable DTP withswitchport nonegotiate.