802.1Q trunking
A trunk port carries traffic for many VLANs over a single cable by tagging each frame with a 4-byte 802.1Q header. This chapter explains the tag format, the native VLAN concept, and the configuration on both sides of a trunk.
What you'll learn
- Describe the 802.1Q tag format and the role of the native VLAN.
- Configure a trunk and restrict its allowed VLAN list.
- Diagnose a native-VLAN mismatch.
The 802.1Q tag — only 4 bytes
When a frame leaves a trunk port it gets a 4-byte tag inserted between the source MAC and the EtherType. The tag carries the VLAN ID (12 bits, allowing 1–4094) plus a 3-bit Class of Service field (PCP) and a Drop Eligible Indicator (DEI) bit.
When the frame reaches the next switch, the tag is read, the frame is delivered to that VLAN's broadcast domain, and the tag is stripped before the frame leaves any access port.
Trunk configuration on a switch
Configure both ends of a trunk the same way: trunk mode, the same allowed list and the same native VLAN. This course uses VLAN 99 as the native VLAN on every trunk — a VLAN created for that purpose, with no access ports and no hosts.
Switch(config)# interface Gi0/1
Switch(config-if)# switchport mode trunk
Switch(config-if)# switchport trunk allowed vlan 10,20,30,99
Switch(config-if)# switchport trunk native vlan 99
Switch(config-if)# end
Switch# show interfaces trunk8 more sections in this chapter, plus a 4-question quiz and a hands-on lab.
Modules 2–8 are part of the Course & Lab Pass and All-Access Max — start with a free account
You can see the title, summary, learning objectives and the opening sections. The rest of this chapter, like all of modules 2–8, comes with the Course & Lab Pass and All-Access Max. A free account opens Module 1: How Networks Work end-to-end and saves your labs — start there, no card required.
- Read every chapter in Module 1 — How Networks Work
- Save labs of up to 5 devices
- Save up to 3 topologies
- See the full course syllabus + chapter titles
Free account · no card required · compare plans any time
Build it step by step
- One VLAN across two switchesSplit four PCs into two VLANs across two switches, then carry both VLANs between the switches over a single tagged trunk. · 7 steps · ~18 min · 6 devices
- Router on a stickSplit one switch into two VLANs and route between them over a single router port. · 8 steps · ~18 min · 4 devices
- Fix it: Fix the VLAN that stops at the trunkEngineering's server is unreachable and the south desk is cut off completely. Find the wrong VLAN and the trunk that drops it. · 6 steps · ~15 min · 5 devices
- Campus capstonePut it all together: two wiring closets, two VLANs, DHCP for the desks, and one public address for the whole site. · 9 steps · ~35 min · 8 devices
- Branch office capstoneStaff and guests on one switch: guests lease an address the moment they plug in, reach the internet, and never see a staff file. · 10 steps · ~40 min · 7 devices
- Redundant campusDouble every link and box between a desk and HQ — bundled, spanning-tree protected, VRRP gateways, twin OSPF circuits — then break two of them and keep working. · 10 steps · ~50 min · 8 devices