Pcornel
H3 · Practical network exams · Cisco IOS / IOS XE

Router-on-a-Stick · Finals

Configuration first, verification second, theory third. Reference templates require task-specific adaptation.

Content version 1.1-draft

Keyboard shortcuts

/ Finals search · Ctrl K global command palette · Alt E Exam Mode · Alt G Golden Scripts · Alt T Exam Topics · Alt V Verify · Esc close dialog.

Case Skills Exam · Supporting reference, not an additional exam objective

Quick explanation

A router uses 802.1Q subinterfaces on a physical trunk to act as the default gateway for multiple VLANs.

Configuration

Replace highlighted placeholders. Configure only the variants required by the task.

Prerequisites and dependency links
  • Create VLANs and configure the connected switch trunk.
  • Use unique VLAN tags and matching native VLAN settings.
IPv4 tagged subinterface Recommended / essential starting point
Start in privileged EXEC; block enters and exits configuration mode. Section link
enable
configure terminal
interface [INTERFACE]
 no shutdown
 exit
interface [INTERFACE].[SUBINTERFACE-ID]
 encapsulation dot1Q [VLAN-ID]
 ip address [IP-ADDRESS] [SUBNET-MASK]
 exit
end
Command parameters
[INTERFACE]
Local interface name including type and number, or an SVI as appropriate.
[SUBINTERFACE-ID]
Local subinterface suffix, commonly matching its VLAN ID.
[VLAN-ID]
VLAN identifier.
[IP-ADDRESS]
Local IPv4 interface address.
[SUBNET-MASK]
IPv4 dotted-decimal subnet mask.
Peer configuration — Connected switch

Peer blocks use the peer's own local interfaces and identifiers. Shared values must agree; other placeholders are interpreted from that device's perspective.

Shared: VLAN-ID

  • Include the tagged VLAN in the allowed list; omit encapsulation selection only on fixed 802.1Q switches.
enable
configure terminal
vlan [VLAN-ID]
 exit
interface [INTERFACE]
 switchport
 switchport trunk encapsulation dot1q
 switchport mode trunk
 switchport trunk allowed vlan [ALLOWED-VLANS]
 no shutdown
 exit
end
IPv6 tagged subinterface Task-specific configuration — essential if selected
Start in privileged EXEC; block enters and exits configuration mode. Section link
enable
configure terminal
ipv6 unicast-routing
interface [INTERFACE]
 no shutdown
 exit
interface [INTERFACE].[SUBINTERFACE-ID]
 encapsulation dot1Q [VLAN-ID]
 ipv6 address [IPV6-ADDRESS]/[PREFIX-LENGTH]
 exit
end
Command parameters
[INTERFACE]
Local interface name including type and number, or an SVI as appropriate.
[SUBINTERFACE-ID]
Local subinterface suffix, commonly matching its VLAN ID.
[VLAN-ID]
VLAN identifier.
[IPV6-ADDRESS]
Local IPv6 interface address without the prefix length.
[PREFIX-LENGTH]
IPv6 prefix length without slash.
Peer configuration — Connected switch

Peer blocks use the peer's own local interfaces and identifiers. Shared values must agree; other placeholders are interpreted from that device's perspective.

Shared: VLAN-ID

  • Include the tagged VLAN in the allowed list; omit encapsulation selection only on fixed 802.1Q switches.
enable
configure terminal
vlan [VLAN-ID]
 exit
interface [INTERFACE]
 switchport
 switchport trunk encapsulation dot1q
 switchport mode trunk
 switchport trunk allowed vlan [ALLOWED-VLANS]
 no shutdown
 exit
end
Native VLAN subinterface Optional when requested
Start in privileged EXEC; block enters and exits configuration mode. Section link
  • Match the switch-side native VLAN.
enable
configure terminal
interface [INTERFACE]
 no shutdown
 exit
interface [INTERFACE].[SUBINTERFACE-ID]
 encapsulation dot1Q [NATIVE-VLAN] native
 ip address [IP-ADDRESS] [SUBNET-MASK]
 exit
end
Command parameters
[INTERFACE]
Local interface name including type and number, or an SVI as appropriate.
[SUBINTERFACE-ID]
Local subinterface suffix, commonly matching its VLAN ID.
[NATIVE-VLAN]
Matching native VLAN ID on trunk peers.
[IP-ADDRESS]
Local IPv4 interface address.
[SUBNET-MASK]
IPv4 dotted-decimal subnet mask.
Peer configuration — Connected switch

Peer blocks use the peer's own local interfaces and identifiers. Shared values must agree; other placeholders are interpreted from that device's perspective.

Shared: NATIVE-VLAN

  • Include the tagged VLAN in the allowed list; omit encapsulation selection only on fixed 802.1Q switches.
enable
configure terminal
vlan [NATIVE-VLAN]
 exit
interface [INTERFACE]
 switchport
 switchport trunk encapsulation dot1q
 switchport mode trunk
 switchport trunk native vlan [NATIVE-VLAN]
 switchport trunk allowed vlan [ALLOWED-VLANS]
 no shutdown
 exit
end

Show / Verify

Primary verification Section link
show ip interface brief
Example output
Gi0/0.10  192.0.2.1  YES manual  up  up

Verify the parent and subinterface state.

Detailed verification Section link
show interfaces [INTERFACE].[SUBINTERFACE-ID]
Example output
Encapsulation 802.1Q Virtual LAN, Vlan ID  10.

Check the configured VLAN tag.

Detailed verification Section link
show interfaces trunk
Example output
Gi0/1  on  802.1q  trunking  99

Run on the connected switch and check allowed VLANs.

Detailed verification Section link
show ipv6 interface brief
Example output
Gi0/0.10   [up/up]
    2001:DB8:10::1

Check the IPv6 address and status of the tagged subinterface.

Connectivity verification

IPv4 reachability

Check success rate; use source or VRF context if required.

ping [DESTINATION-IP]
IPv6 reachability

Check IPv6 path and return routing.

ping ipv6 [DESTINATION-IPV6]
IPv4 path

Inspect hop sequence; missing responses alone do not prove forwarding failure.

traceroute [DESTINATION-IP]
IPv6 path

Inspect IPv6 hop sequence.

traceroute ipv6 [DESTINATION-IPV6]

Common mistakes

  • Physical router interface shut down.
  • Wrong VLAN tag.
  • Native VLAN mismatch.
  • Missing switch trunk.

Configuration comparison

SVI vs router-on-a-stick — SVI routes within a multilayer switch; a router subinterface uses 802.1Q encapsulation on an external trunk.

Remove configuration — separate, potentially disruptive actions

Remove subinterface

Removes the VLAN gateway and disrupts its connectivity.

enable
configure terminal
no interface [INTERFACE].[SUBINTERFACE-ID]
end

Related reference

Networking technical reference · Interface types · Connectivity verification

Reset checklist?

Command block

Back to Top

Confirmation

Confirm action

Continue?