LOGBOOK

HELP

Quiz Entry - updated: 2026.07.05

How do you configure router subinterfaces for router-on-a-stick inter-VLAN routing?

Create a subinterface for each VLAN (Virtual Local Area Network) using interface <physical>.<subif-number>, configure encapsulation dot1q <vlan-id> and assign an IP (Internet Protocol) address, then enable the physical interface with no shutdown.

Router-on-a-stick topology with one trunk link to the router carrying multiple VLANs to subinterfaces.

* Single trunk link to router subinterfaces. — Engineertcarman, CC BY-SA 4.0, via Wikimedia Commons. *

Subinterface configuration:

R1(config)# interface G0/0/1.10
R1(config-subif)# description Default Gateway for VLAN 10
R1(config-subif)# encapsulation dot1Q 10
R1(config-subif)# ip add 192.168.10.1 255.255.255.0
R1(config-subif)# exit

R1(config)# interface G0/0/1.20
R1(config-subif)# description Default Gateway for VLAN 20
R1(config-subif)# encapsulation dot1Q 20
R1(config-subif)# ip add 192.168.20.1 255.255.255.0
R1(config-subif)# exit

R1(config)# interface G0/0/1.99
R1(config-subif)# description Default Gateway for VLAN 99
R1(config-subif)# encapsulation dot1Q 99
R1(config-subif)# ip add 192.168.99.1 255.255.255.0
R1(config-subif)# exit

Then enable the physical interface:

R1(config)# interface G0/0/1
R1(config-if)# description Trunk link to S1
R1(config-if)# no shut

Important details:

  • The subinterface number (e.g., .10) doesn't have to match the VLAN ID, but it's customary to match them for clarity
  • The native keyword is appended to encapsulation dot1q only for the native VLAN subinterface
  • If the physical interface is shut down, all subinterfaces go down with it
  • Each subinterface must be on a unique subnet

Go deeper:

From Quiz: NETW2 / Inter-VLAN Routing | Updated: Jul 05, 2026