802.1Q trunks, the native VLAN and the allowed list
What a trunk carries, what it quietly refuses, and the three checks that tell a dead VLAN from a dead trunk.
That was the first 20 seconds
The full 11 min walkthrough is in Daveth Pro (Network).
Upcoming practical lab
Trunks that won't form
After 2 topics: this one and the next · Fix lab · Three switches somebody else configured, four PCs
View topology, objectives and expected results
Three switches in a triangle, two VLANs, and an engineering PC that cannot reach another. Each of the three links between the switches is wrong in its own way. A fix lab names the commands that read, never the commands that fix.
What you will do
- Reproduce the ticket from PC2
- Find which links are trunks at all
- Compare what each end asked for with what it got
- Make both ends of each link agree
- Find the trunk that carries only one VLAN, and prove the third link
- Put the network back, and keep it
What it looks like when it works
All three links trunk and carry both VLANs, PC2 reaches PC4, and every answer is read off the switches as they are when it is given.
Open the lab benchThe bench opens on this lab. It needs a computer: phones and tablets are not supported.
One cable, one dead VLAN
Two access switches, SW1 and SW2, joined by one cable between their Gi1/0/2 ports. Each has a PC in VLAN 10 and a guest laptop in VLAN 99.
The PCs reach each other. The guests don't. Same cable, same two ports, same green link light.
If you've ever been on a motorway where cars get through and lorries are turned away, you already know the shape of this problem. The road is fine. There's a rule about lorries. Same here: the cable is fine, and something is being decided per VLAN, on a link that's working.
Think about the last time you had a washing machine fill up with water and then refuse to spin. The water supply was fine, so you stopped blaming the tap and looked at the machine. Same move here: stop suspecting the cable, and follow one frame across to see what decision is being made.
A green link light is the network's version of "works on my machine". True, and no help at all.
What a trunk actually carries
First, why VLANs at all. A router between two LAN segments splits them into smaller broadcast domains. You can think of a broadcast as someone standing up in an open-plan office and shouting "has anyone seen my keys?". The broadcast domain is everyone who hears it. The bigger the room, the more people get interrupted.
But hosts get placed on segments by their addressing, and that leaves unused switch ports on one segment while another runs out. It's like having to seat people by which department's phone line reaches their desk, instead of where there's a free chair. VLANs fix both: one switch is split, logically, into several broadcast domains, and any port can join whichever VLAN it needs. Soundproof walls, without anybody moving desks.
Before VLANs, moving someone to another department could mean moving their desk to wherever that department's wiring was. With VLANs it's one command, and nobody carries a monitor down the corridor.
Inside one switch, VLANs need no help. The switch knows which port is in which VLAN and floods a broadcast only to ports in the same VLAN: each VLAN is its own broadcast domain on shared hardware. Devices in different VLANs can't reach each other at Layer 2 at all.
Now add a second switch and one cable, and there's a problem. A frame arriving on SW2 from that cable looks like any other frame. Which VLAN was it in on SW1? Nothing in a normal frame says. If you've ever checked a bag at an airport, you know the fix: before the bag goes on the shared conveyor, someone clips a tag on it saying where it's going, and at the other end the tag is read and the bag goes to the right carousel. 802.1Q does exactly that to a frame. Or, closer to home, it's basically like writing names on food boxes before they go in the office fridge: the fridge is shared, and the label is the only thing that says whose lunch it is.
The four bytes (32 bits), which is all an 802.1Q tag is:
| Field | Bits | Holds |
|---|---|---|
| TPID | 16 | always 0x8100: "this frame is tagged" |
| PCP | 3 | a class of service, 0 to 7 (QoS uses it: module 05) |
| DEI | 1 | drop-eligible; 0 by default |
| VLAN ID | 12 | the VLAN the frame belongs to |
At the far end, the receiving switch reads the VLAN ID, files the frame in that VLAN, removes the tag, and forwards the frame by MAC address within that VLAN. Think of it as the visitor badge you're handed at reception: you wear it while you're in the building, and you hand it back on the way out. The PC on the far side never sees a tag.
Four bytes. That's the whole trick. Four bytes, and the network stops mixing up the PCs and the guests.
The tag lives exactly as long as the trunk. No PC on an access port ever sends or receives one. So say it plainly: a trunk doesn't carry VLANs. It carries frames that say which VLAN they belong to.
Twelve bits give 4096 values, 0 to 4095. Not all are usable: VLAN 0 is reserved for 802.1p traffic, and the VLANs you can configure run from 1 to 4094. On a Catalyst switch, 1 is the default and can't be deleted, 2 to 1001 is the normal range, 1002 to 1005 are reserved, and 1006 to 4094 is the extended range.
You'll see 802.1Q quoted as 4094 VLANs and as 4096. Nobody's wrong, the same way a 100-seat theatre with two seats taped off is still "100 seats". One counts the values, the other counts the ones you can use.
Continue the lesson
The whole lesson, with its drawings and its questions. 9 more sections after the ones above.
