Pcornel
Networking · Switching › VLAN

Inter-VLAN Routing

Cheat sheet · https://pcornel.dk/topic.php?topic=587

Back to the Topic

Answer

Inter-VLAN routing forwards traffic between VLANs at Layer 3, using either SVIs on a Layer 3 switch or subinterfaces on a router connected by a trunk (router-on-a-stick). Each VLAN's hosts use the router's address in that VLAN as default gateway.

Remember

First prove each VLAN works locally: host to its own gateway. Then check that routing is on (ip routing on a Layer 3 switch), that both subnets are connected routes, and that nothing filters in between (ACLs on the SVIs). Wrong host default gateway or mask is a common cause.

First checks

  • show ip interface brief — gateway interfaces up/up with addresses.
  • show ip route connected — each VLAN subnet present as a connected route.
  • show ip arp vlan <id> — hosts resolved in each VLAN.
  • show running-config | include ip routing — routing enabled on a Layer 3 switch.
  • show ip interface vlan <id> | include access list — ACLs on the SVI.

Commands

ip routing

Verify in this order

each host reaches its own gateway → gateway interfaces up → both subnets connected → routing enabled → no ACL blocks → hosts in different VLANs reach each other

Where it usually breaks

physical link → switchport/bundle membership → VLAN/instance state → STP/LAG decision → MAC forwarding → end-to-end frame path

Inter-VLAN routing methods

MethodLayer 2 handoffLayer 3 gatewayTypical use
Layer 3 switchAccess/trunk VLANs terminate on switchSVI per VLANCampus/multilayer switching
Router-on-a-Stick802.1Q trunk to routerRouter subinterface per VLANSmall/lab/external-router design

Read-only verification commands unless stated otherwise. Confirm syntax for your platform and release. Full reference: https://pcornel.dk/topic.php?topic=587

Confirmation

Confirm action

Continue?