VLAN Trunking and 802.1Q Encapsulation Explained
VLAN trunking allows a single physical link between switches to carry traffic for multiple VLANs by adding an 802.1Q tag to Ethernet frames.
What is a Trunk Link?
While an access link carries traffic for a single VLAN, a **trunk link** is designed to carry traffic for multiple VLANs across a single physical connection between switches or between a switch and a router. Without trunking, you would need a separate physical link for each VLAN, which is highly inefficient and not scalable.
IEEE 802.1Q Encapsulation
To distinguish which frame belongs to which VLAN over a trunk link, switches use encapsulation. The industry standard is **IEEE 802.1Q** (often called dot1q). 802.1Q inserts a 4-byte tag into the original Ethernet frame header. This tag includes a 12-bit VLAN ID field, allowing for up to 4,096 distinct VLANs on a network.
The Native VLAN Concept
The native VLAN is a special VLAN configured on a trunk link that carries untagged traffic. When a switch receives an untagged frame on a 802.1Q trunk, it forwards it to the native VLAN. By default, the native VLAN is VLAN 1. For security reasons, it is a Cisco best practice to change the native VLAN to an unused, non-default VLAN to prevent VLAN hopping attacks.
❓ Frequently Asked Questions
What command configures a trunk port?
The interface command `switchport mode trunk` unconditionally sets the port to trunking mode.
What is the ISL protocol?
ISL (Inter-Switch Link) is a legacy Cisco-proprietary trunking protocol, largely replaced by the open standard 802.1Q.
How do you change the native VLAN?
Use the interface command `switchport trunk native vlan [vlan-id]` on both ends of the trunk link.