Key Concepts
| Term | Description |
|---|---|
| VLAN (Virtual LAN) | A logical segmentation of a Layer 2 network |
| Access Port | Belongs to a single VLAN; used for end devices |
| Trunk Port | Carries traffic for multiple VLANs simultaneously |
| Native VLAN | The VLAN used for untagged frames on a trunk (default = VLAN 1) |
| 802.1Q Tag | A 4-byte header inserted into Ethernet frames to identify the VLAN ID |
| Allowed VLANs | VLANs permitted on a trunk (others are filtered) |
Why Trunking?
Without trunking, each VLAN would need its own physical cable between switches. Trunking allows VLAN tagging, enabling multiple VLANs to share one link.Example: A single fibre uplink between two switches can carry VLANs 10, 20, and 30 using 802.1Q tagging.
Cisco Configuration Examples
- Trunk Configuration
- Access Port
Switch to Switch Trunk LinkVerification:Explanation:
switchport mode trunkenables 802.1Q taggingallowed vlandefines which VLANs are permittednative vlandefines which VLAN is untagged (commonly changed from VLAN 1 for security)
Native VLAN Security
| Risk | Mitigation |
|---|---|
| VLAN hopping attacks | Avoid VLAN 1 for native VLAN |
| Untagged frames being misinterpreted | Use a dedicated, unused VLAN as native (e.g. VLAN 99) |
| Management traffic exposure | Isolate management VLANs from user VLANs |
802.1Q Frame Structure
| Field | Size (bytes) | Description |
|---|---|---|
| Destination MAC | 6 | Target host address |
| Source MAC | 6 | Sender address |
| TPID (Tag Protocol ID) | 2 | 0x8100 identifies 802.1Q |
| TCI (Tag Control Info) | 2 | Contains VLAN ID (12 bits) + Priority bits |
| EtherType | 2 | Identifies payload type |
| Payload | 46–1500 | Frame contents |
| FCS | 4 | Frame Check Sequence |
Linux VLAN Trunking Configuration
- ip command
- Verification
Create VLAN interfaces using ip command
Proxmox / Virtualised Lab Example
In homelabs or hypervisors like Proxmox VE, VLAN trunking allows VMs to connect to multiple VLANs through tagged interfaces.Proxmox Bridge Configuration
Example/etc/network/interfaces:
- Assign
vmbr0as the network bridge - Set VLAN tag under “Hardware → Network Device → VLAN Tag”
VLANs in AWS VPCs (Analogy)
While AWS doesn’t expose VLANs directly, similar isolation concepts exist:| Concept | Cisco Equivalent | Purpose |
|---|---|---|
| VPC | VLAN / VRF | Logical network isolation |
| Subnet | VLAN segment | IP range within a VPC |
| Route Table | L3 Routing | Determines inter-subnet connectivity |
AWS uses software-defined networking rather than traditional VLANs, but the isolation principles are similar.
Lab Exercise
Troubleshooting Commands
- Show Commands
- Connectivity Tests
Best Practices
Change Native VLAN
Use a dedicated unused VLAN (not VLAN 1) as native VLAN
Limit Allowed VLANs
Only allow necessary VLANs on trunk ports
Document Configuration
Maintain clear documentation of VLAN assignments
Use Descriptive Names
Add descriptions to all trunk and access ports
Isolate Management
Keep management VLAN separate from user VLANs
Monitor Trunk Utilization
Monitor trunk links for congestion