Pcornel
Browse topics
Options
Recent
Favorites
Networking · Technical reference

Router-on-a-Stick

Direct answer

Router-on-a-stick routes between VLANs over one trunk link: the switch port is a trunk, and the router has one subinterface per VLAN with encapsulation dot1Q <vlan> and the VLAN's gateway address.

When to use this

Use it where a router (or firewall) without enough ports must route several VLANs, or when one VLAN on such a link does not route.

First 30 seconds

1. Switch: show interfaces trunk — VLAN in the allowed and forwarding lists?

2. Router: show ip interface brief — physical interface and subinterface up?

3. show running-config interface <if>.<n> — encapsulation dot1Q matches the VLAN?

4. Native VLAN handled consistently on both ends?

5. Ping the subinterface address from a host in that VLAN.

Operational verification

switch port trunking → VLAN allowed and forwarding → router subinterface with matching dot1Q VLAN → subinterface up with gateway address → hosts resolve the gateway → traffic routed between VLANs

Evidence · next step

Compare router encapsulation with switch allowed/native VLAN state and packet tags for the failing VLAN.

Continue only after interpreting the current observation.
Context & applicabilityCommon mistakes · platform/version boundaries
Platform / version applicability
Cisco IOS / IOS XE
applies
Structured applicability is explicit Topic metadata; it does not infer compatibility beyond the stored rows.
At a glance

Operational reference

Fast context before you go deeper.

PlatformCisco IOS / IOS XE · Cisco IOS XE
Key commandinterface <interface>.<subinterface>
Scope / prerequisiteUse it where a router (or firewall) without enough ports must route several VLANs, or when one VLAN on such a link does…
Show · 1Reference · 4
What next?3 suggested next steps
Catalog command links5
Evidence1
On this pageJump to a specific section
Cisco IOS / IOS XE first

Primary Commands

Configuration and operational commands for this Topic.

Verification

Show Commands

Read-only Cisco show commands for confirming state, narrowing a fault and interpreting the current boundary.

Operational workflow

Verification & Troubleshooting

Start with the observed symptom, prove the nearest boundary, and move outward only when the current state is understood.

2 steps Observe → verify → isolate → change minimally → repeat the original test.
ObservedRecord what the original test actually shows

Capture the concrete output, symptom, packet, log or counter before changing anything.

Step 1 Verification and output interpretation Verify boundary

Check the switch trunk for allowed/active VLANs and native VLAN state, then verify the router physical interface and each subinterface are operational with the correct encapsulation and IP address. Connected routes should exist for every active subinterface subnet. Use ARP and route/CEF lookups to validate representative endpoints. A subinterface can look correctly configured while its VLAN is not actually allowed on the trunk, so verify both sides. When only one VLAN fails, compare that VLAN's tag/allowance/subinterface mapping rather than assuming the shared physical link is the issue.

Step 2 Packet path Narrow the fault

Host frame → access VLAN → switch trunk adds/handles 802.1Q tag → router subinterface classifies VLAN tag → Layer 3 route decision → egress subinterface/VLAN → destination access port. A wrong tag on one router subinterface can break only that VLAN while the physical link and other VLANs remain healthy.

Evidence references

Evidence · 1 on this Topic

Expected observations and documentation recipes are reference material. Record actual output, device identity, scope and time before claiming a verified result.

state · 1
Command lookup Jump straight to Cisco syntax
Key points

Each subinterface's VLAN number must match a VLAN the switch trunk allows. The native VLAN is untagged: either use encapsulation dot1Q <vlan> native on the router or keep the native VLAN unused. The physical router interface must be no shutdown.

Key checks
  • show interfaces trunk (switch) — trunk up, VLANs allowed and forwarding.
  • show ip interface brief (router) — subinterfaces up/up.
  • show running-config interface <if>.<n> (router) — encapsulation VLAN and address.
  • show vlans (router) — dot1Q VLANs and their subinterfaces.
  • show ip arp (router) — hosts resolved per subinterface.
ReferenceImportant terms & boundaries4 sections · depth on demand

In depth

Router-on-a-stick: one trunk, one subinterface per VLAN

In router-on-a-stick, a router has one physical link to the switch, configured as an 802.1Q trunk. The router creates a subinterface for each VLAN, with encapsulation dot1Q <vlan> and the gateway address for that VLAN.

R1(config)# interface GigabitEthernet0/0/1
R1(config-if)# no shutdown
R1(config)# interface GigabitEthernet0/0/1.20
R1(config-subif)# encapsulation dot1Q 20
R1(config-subif)# ip address 10.20.0.1 255.255.255.0
R1(config)# interface GigabitEthernet0/0/1.30
R1(config-subif)# encapsulation dot1Q 30
R1(config-subif)# ip address 10.30.0.1 255.255.255.0
R1(config)# interface GigabitEthernet0/0/1.998
R1(config-subif)# encapsulation dot1Q 998 native
C9300(config)# interface GigabitEthernet1/0/48
C9300(config-if)# switchport mode trunk
C9300(config-if)# switchport nonegotiate
C9300(config-if)# switchport trunk native vlan 998
C9300(config-if)# switchport trunk allowed vlan 20,30,998
R1# show ip interface brief | include 0/0/1
GigabitEthernet0/0/1      unassigned      YES unset  up                    up
GigabitEthernet0/0/1.20   10.20.0.1       YES manual up                    up
GigabitEthernet0/0/1.30   10.30.0.1       YES manual up                    up

The switch side (from the Catalyst 9300 trunk guide)

PointDetail
Trunk modeswitchport mode trunk on the switch port; DTP is pointless towards a router, so add switchport nonegotiate
Native VLANMust match at both ends (the router's native subinterface)
Allowed VLANsRestrict to the routed VLANs
Catalyst 9300 itselfThe guide states Layer 3 trunks and subinterfaces aren't supported; the switch routes with SVIs instead

Trade-offs

Router-on-a-stickLayer 3 switch (SVIs)
ThroughputLimited by one link; traffic between VLANs crosses it twiceSwitch backplane
CostUses an existing routerNeeds a Layer 3 switch
Typical useSmall branches, labs, firewalls as gatewaysCampus

Troubleshooting

SymptomCause
One VLAN can't reach its gatewayVLAN missing from the allowed list, or wrong encapsulation dot1Q number
Native VLAN traffic lostNative mismatch between switch and router
Slow inter-VLAN trafficThe trunk link is saturated

Documented example, not captured output.

Source basisSource attribution states what this section is based on; it is not independent proof that the current environment matches it.

Quick reference

Router-on-a-stick routes between VLANs with one router interface connected to a switch trunk. Each VLAN gets a subinterface with encapsulation dot1Q <vlan> and the gateway address for that VLAN.

interface Gi0/0.20
 encapsulation dot1Q 20
 ip address 10.20.0.1 255.255.255.0
interface Gi0/0.30
 encapsulation dot1Q 30
 ip address 10.30.0.1 255.255.255.0
interface Gi0/0.99
 encapsulation dot1Q 99 native

Documented example, not captured output.

All inter-VLAN traffic crosses the single link twice, so throughput is limited; it suits small branches and labs.

Source basisSource attribution states what this section is based on; it is not independent proof that the current environment matches it.

State model and protocol mechanics

Router-on-a-stick uses one physical Ethernet link between a switch and router as an 802.1Q trunk. The router creates logical subinterfaces, each configured with a VLAN encapsulation identifier and an IP gateway address. Frames from an access VLAN are tagged by the switch when sent across the trunk, delivered to the matching router subinterface, routed, then emitted through the appropriate destination subinterface and VLAN. A native VLAN may be represented as untagged traffic depending on the configuration and must agree on both ends. Because multiple routed VLANs share one physical interface, the link is a common bandwidth and failure point. The model is conceptually simple but couples Layer-2 trunk correctness directly to all inter-VLAN routing on that router.

Limits and common misconceptions

Physical link up/up does not show every subinterface/VLAN is working. One incorrect VLAN ID can isolate only one subnet while others continue to route. A trunk carrying the VLAN does not show the router subinterface has the right addressing or policy. Router-on-a-stick also does not provide the same scale or failure isolation as distributed Layer-3 switching because many VLANs depend on one link/router interface. Keep trunk transport, VLAN tag mapping, subinterface state, IP routing and endpoint configuration distinct. A working gateway ping from the router itself can also bypass the endpoint's access-port, DHCP and host-firewall conditions, so preserve host-side evidence when validating the complete service path.

ReferenceConfiguration & state2 sections · depth on demand

Cisco IOS / IOS XE baseline

A common design uses a switch port in static trunk mode and a router physical interface with one subinterface per VLAN. Each subinterface uses encapsulation dot1q <vlan> (or ... native only when intentionally matching the switch native VLAN) plus the gateway IP address for that VLAN.

Design and configuration model

Configure the switch-facing interface as an explicit trunk and allow only the VLANs required by the design. On the router, create one subinterface per VLAN, configure the correct encapsulation dot1q VLAN ID and assign the subnet gateway address. If a native VLAN is used, ensure both sides agree and document why. Keep the physical interface enabled while leaving IP addressing on subinterfaces rather than mixing models accidentally. Add upstream routing beyond the connected VLANs as required. Capacity planning matters because traffic between VLANs crosses the same physical link twice in terms of ingress/egress utilization on the router path.

Additional reference context Scope · expected state · examples · history · terminology Open only when you need the supporting context
Technical verification history

Verification history & basis

When and against what this Topic was checked. Later text edits do not count as a new check.

2026-09-14 · vendor docCisco IOS / IOS XE Current documentation reviewed 2026-09-14

Authoritative/upstream documentation reviewed for bounded claims in Switching → VLAN → Inter-VLAN Routing → Router-on-a-Stick. Documentation verification only; this is not observed lab or production Evidence.

Basis: https://www.cisco.com/c/en/us/support/ios-nx-os-software/ios-xe-17/series.html · confidence 94%
Embedded reference data

Quick lookup tables

Router-on-a-Stick · operational reference

Compact state and interpretation boundaries for fast lookup.

ComponentRequired state
Switch trunkVLAN allowed/forwarding
Router subinterfaceMatching dot1q ID + IP
RIBConnected subnet installed
EndpointCorrect gateway/subnet
Confirmation

Confirm action

Continue?