VLAN, Trunking, and Inter-VLAN Routing
(Router-on-a-Stick)
1. VLAN (Virtual LAN)
- VLAN divides a single physical switch into multiple logical networks.
- Each VLAN is a separate broadcast domain.
- Example:
VLAN 10 - IT
VLAN 20 - HR
VLAN 30 - Finance
2. Access Port
- Used for end devices (PCs).
- Carries only one VLAN.
- No tagging is used.
3. Trunk Port
- Used between switches and between switch and router.
- Carries multiple VLANs.
- Uses IEEE 802.1Q tagging to identify VLANs.
4. Inter-VLAN Routing
- VLANs cannot communicate directly.
- A router is required to route traffic between VLANs.
5. Router-on-a-Stick
- One physical router interface is divided into multiple subinterfaces.
- Each subinterface is assigned to a VLAN using 802.1Q encapsulation.
Example:
Fa0/0.10 → VLAN 10 → [Link]
Fa0/0.20 → VLAN 20 → [Link]
Fa0/0.30 → VLAN 30 → [Link]
6. Default Gateway
- Each device uses router IP of its VLAN as gateway.
7. Traffic Flow
- PC → Switch → Trunk → Router → Route → Back via correct VLAN
8. Key Dependencies
- VLAN must exist
- Ports must be assigned
- Trunk must be configured
- Router subinterfaces must exist
- Gateway must be set
9. Common Issues
- Wrong VLAN assignment
- Missing trunk
- Incorrect VLAN ID
- No IP/gateway
- Interface shutdown