← Module 03 · Layer 3: Network

Inter-VLAN Routing

A switch will never forward traffic between two VLANs (Virtual Local Area Networks), on purpose. That's the whole point of a VLAN. Something at Layer 3 has to do it deliberately.

Recall why this is even necessary

Back in Collision Domain vs Broadcast Domain: a router (or something doing Layer 3 work) is what breaks up broadcast domains, and VLANs exist specifically to create multiple broadcast domains on one switch. So naturally, getting traffic between two VLANs requires exactly the kind of device that breaks broadcast domains apart in the first place. A switch alone will never do it.

Option 1: Router-on-a-stick

A single physical link runs from the switch to a router as an 802.1Q trunk, and the router carries a separate subinterface for each VLAN, each one acting as that VLAN's gateway. One physical interface, logically sliced into as many virtual ones as there are VLANs.

Option 2: Layer 3 switch with SVIs

A Layer 3 switch can do the routing itself, with no separate router at all. Each VLAN gets a Switched Virtual Interface (SVI), a virtual interface configured directly on the switch that acts as that VLAN's gateway. Since the switch is already routing in hardware at wire speed, this scales far better than funneling all inter-VLAN traffic through one router link.

ROUTER-ON-A-STICK Switch VLAN 10 / 20 Router .10 / .20 sub-if one trunk L3 SWITCH WITH SVIs Layer 3 Switch SVI VLAN 10 (gateway) SVI VLAN 20 (gateway) routes between them internally
Router-on-a-stick funnels every inter-VLAN packet through one link and one router. An L3 switch routes internally, at hardware speed.
Router-on-a-stickL3 switch with SVIs
Extra hardware neededA router, plus a trunk linkNone, the switch does it natively
ThroughputLimited by the one trunk linkWire-speed, routed in hardware
Common inSmall networks, labs, legacy setupsMost modern production networks
WHY MOST PRODUCTION NETWORKS SKIP THE ROUTER ENTIRELY

Router-on-a-stick is genuinely useful for learning the concept with minimal hardware, but every inter-VLAN packet has to leave the switch, cross the trunk, get routed, and come back: a real bottleneck under load. An L3 switch's SVIs remove that round trip entirely, which is why they're the default choice once a network outgrows a lab setup.