Octet

What is the difference between router-on-a-stick and SVIs for inter-VLAN routing?

Show the answer

Say this first

Router-on-a-stick routes between VLANs with one router interface split into 802.1Q subinterfaces over a trunk. It is cheap and simple, but every inter-VLAN packet crosses that one link twice and the router's forwarding rate is the ceiling. A layer 3 switch gives each VLAN an SVI and routes in hardware at line rate with no hairpin. Campus networks use SVIs; router-on-a-stick fits a small branch or a lab.

Go deeper

Side by side

Router-on-a-stickSVI on a layer 3 switch
Gateway lives onRouter subinterfaceinterface VlanN
ForwardingRouter CPU or network processorSwitch ASIC
Path between VLANsUp the trunk and back downInside the switch
BottleneckTrunk bandwidth and router throughputRarely the switch
Extra features in the pathNAT, firewall, VPN on the routerUsually only ACLs

Configurations

Cisco IOS
! Router-on-a-stick
interface GigabitEthernet0/0/0.10
 encapsulation dot1Q 10
 ip address 10.10.0.1 255.255.255.0
Cisco IOS
! Layer 3 switch
ip routing
interface Vlan10
 ip address 10.10.0.1 255.255.255.0

The hairpin

A packet from VLAN 10 to VLAN 20 goes up the trunk tagged 10 and comes back down tagged 20. The trunk carries all inter-VLAN traffic plus everything headed to the WAN, so it saturates early.

Traps

  • Thinking the subinterface number must match the VLAN. Only the VLAN in encapsulation dot1Q matters.
How did you do?Book 3.3 Internet (IP)