A structured lesson workspace with readable content, hands-on examples, and a clean path to completion.
! Step 1: Ensure the router interface is upR1(config)# interface gigabitEthernet0/0R1(config-if)# description Trunk-to-SwitchR1(config-if)# no shutdownR1(config-if)# exit! Step 2: Configure subinterfaces — one per VLANR1(config)# interface gigabitEthernet0/0.10R1(config-subif)# description VLAN-10-GatewayR1(config-subif)# encapsulation dot1q 10R1(config-subif)# ip address 10.10.10.1 255.255.255.0R1(config-subif)# exitR1(config)# interface gigabitEthernet0/0.20R1(config-subif)# description VLAN-20-GatewayR1(config-subif)# encapsulation dot1q 20R1(config-subif)# ip address 10.10.20.1 255.255.255.0R1(config-subif)# exitR1(config)# interface gigabitEthernet0/0.30R1(config-subif)# description VLAN-30-GatewayR1(config-subif)# encapsulation dot1q 30R1(config-subif)# ip address 10.10.30.1 255.255.255.0R1(config-subif)# exit
Subinterface numbers don't have to match VLAN IDs — `.10` for VLAN 10 is convention, not requirement. What matters is the `encapsulation dot1q 10` line: that's what tells the subinterface which VLAN's frames to accept. Without it, the subinterface won't process any trunk traffic.
! Switch side: configure the port to the router as a trunkSW1(config)# interface gigabitEthernet0/24SW1(config-if)# description Trunk-to-RouterSW1(config-if)# switchport trunk encapsulation dot1qSW1(config-if)# switchport mode trunkSW1(config-if)# switchport trunk native vlan 999SW1(config-if)# switchport trunk allowed vlan 10,20,30SW1(config-if)# no shutdownSW1(config-if)# exit! Verify the trunkSW1# show interfaces trunk
Don't forget `switchport mode trunk` on the switch side. A default-configured access port plugged into the router will only carry its own VLAN — the router's other subinterfaces never see traffic. This is one of the most common router-on-a-stick configuration mistakes.
Note the physical interface is unassigned but up — subinterfaces own the IPs. All three subinterfaces are up/up, which means the trunk is passing traffic for each VLAN. If any subinterface is down, the switch side isn't trunking that VLAN.
Five out of five successes. Inter-VLAN routing works. If this fails, check in order: (1) is the switch port configured as trunk? (2) does the trunk allow the VLAN? (3) does the router subinterface have encapsulation matching the VLAN? (4) is the source host's default gateway correct?
Router-on-a-stick config is four commands: shut down, subinterface, encapsulation, IP. Verify with `show ip interface brief`. Next lesson covers the more modern and scalable approach — SVIs on a Layer 3 switch.
Finish the lesson once you have worked through the material. This awards ★ 15 XP.