PC-A (192.168.10.10/24, VLAN 10, gateway 192.168.10.1) and PC-C (192.168.20.10/24, VLAN 20, gateway 192.168.20.1) sit on access ports of the same switch. A router-on-a-stick is trunked to that switch on Gi0/1, with sub-interfaces Gi0/1.10 (802.1Q tag 10) and Gi0/1.20 (tag 20) each holding the respective gateway IP. (An L3 switch with SVIs for VLAN 10/20 does the identical job internally — see the gotcha below.)
SetupPC-A runs ping 192.168.20.10. Its stack ANDs the destination against its own /24 mask — 192.168.20.10 does not fall inside 192.168.10.0/24. Unlike the same-VLAN case, PC-A now needs to reach its gateway's MAC, not the destination's.
PC-A's ARP cache has no entry for 192.168.10.1 yet, so it broadcasts "who has 192.168.10.1?" — this broadcast is confined to VLAN 10 only; PC-C on VLAN 20 never sees it, because a broadcast domain stops at the VLAN boundary. The router's Gi0/1.10 sub-interface replies with its MAC.
ARPPC-A sends the ICMP Echo Request addressed to the router's MAC. The switch forwards it out the trunk port toward the router, adding an 802.1Q tag for VLAN 10 on the trunk (the access port itself carries no tag — tagging is a trunk-link-only concept).
802.1QThe frame's Layer 2 destination is now the gateway's MAC, not PC-C's — PC-A still has no idea what PC-C's MAC even is. The packet is about to leave VLAN 10 entirely and be re-originated as a new frame on VLAN 20 by whatever device owns both sub-interfaces/SVIs.
CheckpointThe router receives the frame on Gi0/1.10, strips the VLAN 10 tag and the Ethernet header, and is left with an IP packet destined for 192.168.20.10. It checks its routing table — a connected route for 192.168.20.0/24 points out Gi0/1.20.
L3 RouteThe router checks its own ARP cache for 192.168.20.10 on the VLAN 20 side. First time, it's a miss, so the router broadcasts an ARP request tagged for VLAN 20 back down the trunk. The switch floods it out VLAN 20's access ports; PC-C replies.
ARPThe router builds a brand new Ethernet frame — source MAC is now the router's own Gi0/1.20 MAC, destination is PC-C's MAC — tags it VLAN 20, and sends it back down the trunk. The switch strips the tag at the access port and delivers an untagged frame to PC-C.
L2 Re-frameTo PC-C, this looks exactly like traffic from a same-VLAN neighbor — it has no visibility into the fact that the source is actually on a different VLAN two hops back. It generates an ICMP Echo Reply addressed to its own gateway, 192.168.20.1, because it also does the local-subnet check and determines PC-A isn't local to it.
ICMPPC-C ARPs for its gateway (192.168.20.1) — already cached from step 7 — sends the reply to the router's Gi0/1.20 MAC, tagged VLAN 20. The router routes it back toward 192.168.10.0/24, re-frames it tagged VLAN 20→10 out Gi0/1.10 using PC-A's MAC (learned in step 3), and the switch delivers it untagged to PC-A's access port.
ReturnSubsequent pings skip both ARP resolutions (already cached at PC-A, the router, and PC-C) — every packet still transits the router for the L3 lookup and re-framing, because that's not optional the way ARP caching is; only a route change or ACL would alter that.
Delivered| Term | Meaning |
|---|---|
| Router-on-a-Stick | A router with one physical trunk link to a switch, using sub-interfaces to route between VLANs |
| SVI | Switched Virtual Interface — a logical L3 interface bound to a VLAN, used for inter-VLAN routing inside an L3 switch |
| 802.1Q | The standard for tagging Ethernet frames with a VLAN ID on trunk links |
| Trunk Port | A switchport carrying tagged traffic for multiple VLANs, typically between switches or to a router |
| Access Port | A switchport assigned to exactly one VLAN; frames are untagged on the wire to the end host |
| Native VLAN | The one VLAN on a trunk sent without a tag; must match on both ends of the trunk |
| Broadcast Domain | The scope a broadcast/ARP request reaches — bounded by VLAN, not by physical switch |
| Connected Route | A route the L3 device installs automatically for a subnet directly attached to one of its interfaces/SVIs |
| Inter-VLAN Routing | The general term for moving traffic between VLANs, requiring a Layer 3 device |
| VLAN ACL / Router ACL | A filter applied at the L3 boundary that inter-VLAN traffic must cross, unlike intra-VLAN traffic |