Reference

Core

Inter-VLAN Routing

Inter-VLAN routing allows hosts in different VLANs to communicate, implemented via router-on-a-stick subinterfaces or Layer 3 switching with SVIs.

What you need to know

  • Router-on-a-stick uses one physical interface divided into subinterfaces, each assigned a VLAN and IP via encapsulation dot1Q.
  • Each subinterface must match the VLAN's IP subnet and use encapsulation dot1Q <vlan-id> before an IP address can be applied.
  • The subinterface handling the native VLAN typically omits the native keyword unless the native VLAN itself is being routed with tagging disabled.
  • Layer 3 switches use SVIs (interface vlan X) instead of subinterfaces, avoiding the single physical link bottleneck.
  • ip routing must be enabled globally on a multilayer switch for SVIs to route between VLANs.
  • A switch port connecting to a router for router-on-a-stick must be configured as a trunk, not access.
  • SVIs require the associated VLAN to exist and have at least one active access/trunk port to stay up/up in some IOS versions.

Configuration commands

CommandModePurpose
interface gigabitethernet 0/0.10configCreate subinterface for VLAN 10 on router-on-a-stick.
encapsulation dot1Q 10config-ifBind the subinterface to VLAN 10 tagging.
ip address 192.168.10.1 255.255.255.0config-ifAssign the gateway address for VLAN 10 hosts.
interface gigabitethernet 0/0.99configCreate subinterface for the native VLAN.
encapsulation dot1Q 99 nativeconfig-ifMark this subinterface as carrying the untagged native VLAN.
ip routingconfigEnable IP routing globally on a multilayer switch.
interface vlan 10configCreate an SVI for VLAN 10 on a multilayer switch.
no switchportconfig-ifConvert a physical switch port into a routed Layer 3 port.

Verify it

  • show ip interface brief
  • show ip route
  • show interfaces gi0/0.10
  • show vlan brief
  • show interfaces trunk

Common mistakes

  • Forgetting to configure the switch-side port as a trunk for router-on-a-stick.
  • Mismatching the VLAN number in encapsulation dot1Q with the actual VLAN on the switch.
  • Not enabling ip routing on a multilayer switch, so SVIs never route traffic.
  • Assigning an IP address to the physical interface as well as subinterfaces, causing conflicts.
  • Leaving the SVI or associated VLAN with no active ports, causing the SVI to stay down.

Practise Inter-VLAN Routing in a real CLI

Generated labs, graded against the simulated network state.

Start a free lab