Objectives
| # | Objective |
| 1 | Create VLANs 10 and 20 on SW1 and assign access ports to each VLAN |
| 2 | Configure the SW1βR1 link as an 802.1Q trunk β this is the "stick" in Router-on-a-Stick |
| 3 | Configure R1 subinterfaces: Gi0/0.10 for VLAN 10, Gi0/0.20 for VLAN 20 β with 802.1Q encapsulation and IP addresses |
| 4 | Configure PC IPs and default gateways β the subinterface IP is the gateway for each VLAN |
| 5 | Test inter-VLAN ping: PC1 (VLAN 10) β PC2 (VLAN 20) must succeed via R1 |
| 6 | Open the Packet Trace β step through the VLAN tags, MAC changes and routing decision at each hop |
| 7 | Knowledge check β subinterfaces, 802.1Q encapsulation and the ROAS architecture |
Key Concepts
| Concept | What it means |
| Router-on-a-Stick | One physical router interface connected via a trunk to a switch, with logical subinterfaces handling each VLAN. One cable does the work of many. |
| Subinterface | A logical subdivision of a physical interface. Gi0/0.10 and Gi0/0.20 are both on the same wire but process different VLAN tags independently. |
| encapsulation dot1q | Tells the subinterface which VLAN tag to process. Frames arriving tagged VLAN 10 go to Gi0/0.10; VLAN 20 frames go to Gi0/0.20. |
| Default gateway per VLAN | Each VLAN is its own subnet. PCs in VLAN 10 use R1's Gi0/0.10 IP as their gateway; VLAN 20 PCs use Gi0/0.20. |
| VLAN tag at the router | The trunk delivers tagged frames to R1. R1's subinterface strips the tag, routes the IP packet, then re-tags the outgoing frame with the destination VLAN's tag. |
Addressing Plan
| Device | Interface | IP Address | VLAN / Role |
| PC1 | NIC | 192.168.10.10/24 | VLAN 10 β gateway 192.168.10.1 |
| PC2 | NIC | 192.168.20.10/24 | VLAN 20 β gateway 192.168.20.1 |
| R1 | Gi0/0.10 | 192.168.10.1/24 | VLAN 10 gateway |
| R1 | Gi0/0.20 | 192.168.20.1/24 | VLAN 20 gateway |
| SW1 | Gi0/3 | β | 802.1Q trunk to R1 |
Key Commands β R1
| Command | Purpose |
| interface GigabitEthernet0/0.10 | Create subinterface 10 on Gi0/0 |
| encapsulation dot1q 10 | Tag this subinterface to VLAN 10 |
| ip address 192.168.10.1 255.255.255.0 | Assign IP (this becomes the VLAN 10 gateway) |
| no shutdown (on parent Gi0/0) | Bring the physical interface up β subinterfaces inherit this |
| show ip interface brief | Verify all subinterfaces are up/up with correct IPs |
| show ip route | Confirm connected routes for both subnets appear |
Once both subinterfaces are up and the inter-VLAN ping succeeds, click π¦ Packet Trace to step through the full journey β VLAN tags, MAC rewrites and the routing decision at R1.
The physical interface (Gi0/0) must be no shutdown for subinterfaces to come up. Subinterfaces do not need their own shutdown/no shutdown β they inherit state from the parent.