By default, devices in different VLANs cannot communicate with each other because they are in separate broadcast domains. To enable communication, we need a Layer 3 device to route traffic between them. This is called Inter-VLAN Routing.
Method 1: Router-on-a-Stick (ROAS)
This is the most common method for small to medium networks using a router and a Layer 2 switch.
- Physical Connection: A single physical cable connects the router to the switch.
- Switch Config: The switch port is configured as a Trunk to carry multiple VLANs.
- Router Config: The router interface is divided into logical Sub-interfaces (e.g.,
Gi0/0.10). Each sub-interface is assigned an IP address and a VLAN tag (802.1Q).
Method 2: Layer 3 Switch (SVI)
Enterprise networks often use Layer 3 switches (Multilayer Switches) for faster performance.
- SVI (Switch Virtual Interface): You create a virtual interface for each VLAN (e.g.,
interface vlan 10) and assign it an IP address. - Routing: You must enable IP routing globally on the switch using the command
ip routing.
Comparison
| Feature | Router-on-a-Stick | Layer 3 Switch (SVI) |
|---|---|---|
| Device | Router + L2 Switch | Multilayer Switch |
| Speed | Limited by link speed | Hardware switching (Fast) |
| Cost | Lower | Higher |
| Complexity | Sub-interfaces | Virtual Interfaces |
Next Step: Try configuring Router-on-a-Stick in the Inter-VLAN Routing Lab.