VLAN
Cheat sheet · https://pcornel.dk/topic.php?topic=581
Answer
A VLAN is a separate Layer 2 broadcast domain on shared switches. Each access port belongs to one VLAN; trunks carry several VLANs between switches with an 802.1Q tag; traffic between VLANs needs a router or a Layer 3 switch.
Remember
A VLAN works end to end only if it exists on every switch on the path, the access port is in it, every trunk on the path allows and forwards it, and spanning tree forwards it. A VLAN that does not exist locally is not forwarded, even if a port is assigned to it.
First checks
show vlan brief— VLANs that exist and their access ports.show interfaces <if> switchport— administrative and operational mode, access VLAN, native VLAN.show interfaces trunk— trunks, native VLAN, allowed and forwarding VLANs.show mac address-table vlan <id>— MAC addresses learned in the VLAN and on which port.show spanning-tree vlan <id>— whether the ports forward in that VLAN.
Commands
show vtp status- Shows the VTP version, domain name, operating mode and configuration revision on the switch.
show vlan brief- Does the VLAN exist locally?
show interfaces switchport- Is the endpoint port in the intended VLAN/mode?
show interfaces trunk- Must the VLAN cross a trunk, and is it carried?
show interfaces vlan <id>- Is the VLAN Layer 3 gateway/SVI up?
show ip interface brief- Is the VLAN Layer 3 gateway/SVI up?
show ip route- Is inter-VLAN routing installed?
show spanning-tree vlan <id>
Verify in this order
VLAN exists on every switch → access port in the VLAN → each trunk allows and forwards the VLAN → spanning tree forwards it → MAC addresses learned on the expected ports → hosts reach each other
Where it usually breaks
physical link → switchport/bundle membership → VLAN/instance state → STP/LAG decision → MAC forwarding → end-to-end frame path
VLAN · reference boundaries
| Layer | Reference question | Canonical check |
|---|---|---|
| VLAN database | Does the VLAN exist locally? | show vlan brief |
| Access membership | Is the endpoint port in the intended VLAN? | show vlan brief / interface switchport |
| Trunk carriage | Is the VLAN allowed and operational across the link? | show interfaces trunk |
| STP | Is the VLAN forwarding on the intended path? | show spanning-tree vlan <id> |
| Layer 3 boundary | Is the intended gateway/SVI available? | show ip interface brief / show ip route |
Read-only verification commands unless stated otherwise. Confirm syntax for your platform and release. Full reference: https://pcornel.dk/topic.php?topic=581