VLAN
— IEEE 802.1Q Virtual Local Area Network TaggingIEEE 802.1Q defines how an Ethernet frame carries a VLAN identifier so that a single physical infrastructure can host many logically separate Layer 2 networks. Access ports strip the tag for end devices, while trunk ports keep it so switches can carry several VLANs between each other.
Interactive Session: How VLAN Works
Step through the packet exchange sequence between nodes.
Interactive Execution Sandbox
Interact with a live or clearly-labelled simulated instance of VLAN.
Threat Model & Attack Simulation
How this protocol is attacked in practice, what defenders can see, and which control stops it.
Threat model & attack simulation
SimulatedDefensive education. Every step runs in this page; no traffic is generated or sent.
VLAN double tagging (hop)
Feature abuseA frame with two 802.1Q tags can cross a trunk port when the native VLAN is left untagged.
Craft a stacked tag
The attacker sends a frame tagged with the native VLAN as the outer tag and the victim VLAN as the inner tag.
Frames with two 802.1Q headers on an access port.
Segmentation bypass that exposes hosts in another VLAN.
Defences that matter
- Never use VLAN 1 as the native VLAN
- Tag all traffic on trunks and prune unused VLANs
- Reject double-tagged frames at the edge
This is a conceptual model for defenders, not an exploit toolkit. It contains no payloads, tooling or instructions for attacking systems you do not own.
Protocol Specification & Architecture
Key characteristics, real-world deployment patterns, and trade-offs.
Core Technical Features
- 4-byte tag with TPID 0x8100, PCP, DEI and a 12-bit VID
- Access ports carry one untagged VLAN, trunk ports carry many tagged VLANs
- Native VLAN on a trunk is sent untagged for backward compatibility
- Per-VLAN broadcast domains and Layer 2 isolation
- Priority Code Point bits allow basic QoS classification
Real-World Use Cases
- Separating voice, user and guest traffic on one switch
- Carrying multiple customer networks across a shared uplink
- Isolating servers, management and storage networks
Advantages & Strengths
- Segmentation without extra cabling or switch ports
- Small fixed overhead of only 4 bytes per frame
Limitations & Vulnerabilities
- Misconfigured native VLANs can leak traffic between segments
- VLANs alone provide no routing and no security boundary without ACLs