In this lab, you will configure Inter-VLAN Routing using the Router-on-a-Stick method.
A single physical link between the switch and the router will carry multiple VLANs using 802.1Q encapsulation.
This allows devices in different VLANs to communicate through the router.
Figure 1 - Router on a Stick Topology
Imagine a company where different departments, such as Sales and Tech need to be able to communicate with each other.
So far in this course, you’ve learned:
How VLANs segment broadcast domains
How trunking carries multiple VLANs over a single link
How default gateways allow traffic to leave a subnet
How routers use subinterfaces to route between VLANs
In this lab, you will put all these concepts together.
We’ll walk through each step to configure Router-on-a-Stick, verify the subinterfaces, set gateways, and test inter-VLAN communication directly in Packet Tracer.How to Begin
Before starting, download the Packet Tracer file using the button at the top of the page.
The topology already includes all PC addressing, so you can focus entirely on VLANs, trunking, subinterfaces, and routing verification.Lab Overview
Here’s the structure we will follow throughout this lab:
Step 1 – Set Up VLANs and Switch Ports
Step 2 – Configure Router Subinterfaces
Step 3 – Set Default Gateways on PCs
Step 4 – Test Inter-VLAN Routing
Let’s Get Started
Open the Packet Tracer file and try configuring the VLANs and switch ports on your own first.
This helps you activate prior knowledge before following the guided solution.In the next sections, we’ll walk through each configuration step together and verify that Router-on-a-Stick is working properly.
Answer the question below
In this first step, you will prepare the switch so that each department is placed in the right VLAN.

Figure 2 - Router on a Stick Topology
Your goal here is simple:
create VLANs
assign the PCs to those VLANs
configure the trunk toward the router
This prepares the entire Layer 2 side before the router can route between VLANs.
Create VLAN 10 and VLAN 20
Start by creating the two VLANs used in this lab.
VLAN 10 will group the Sales PCs, and VLAN 20 will group the Tech PCs.Enter the following commands on SW1:
SW1# conf t Enter configuration commands, one per line. End with CNTL/Z. SW1(config)# vlan 10 SW1(config-vlan)# name Sales SW1(config-vlan)# exit SW1(config)# vlan 20 SW1(config-vlan)# name Tech SW1(config-vlan)# exitAt this stage, the switch knows both VLANs exist, but no ports belong to them yet.
Assign Access Ports
Now, you need to place the correct switch ports into the right VLANs.
Ports F0/1–2 → VLAN 10
Ports F0/3–4 → VLAN 20
This ensures each PC belongs to the correct department.
SW1(config)# int range f0/1-2 SW1(config-if-range)# switchport mode access SW1(config-if-range)# switchport access vlan 10 SW1(config-if-range)# no shut SW1(config-if-range)# exit SW1(config)# int range f0/3-4 SW1(config-if-range)# switchport mode access SW1(config-if-range)# switchport access vlan 20 SW1(config-if-range)# exitYou’ve now created two isolated Layer 2 networks.
Configure the Trunk Toward the Router
Next, you must connect SW1 to the router using a trunk.
This trunk is essential: it allows both VLANs to travel over a single physical link (G0/1) using 802.1Q tags.Without this trunk, the router would never see VLAN 10 or VLAN 20.
SW1(config)# int g0/1 SW1(config-if)# switchport mode trunk SW1(config-if)# switchport trunk allowed vlan 10,20 SW1(config-if)# no shut SW1(config-if)# endYour switch is now ready for Router-on-a-Stick.
In the next step, you’ll configure the router so it can route traffic between your VLANs.
Answer the question below
Now that your switch is ready and the trunk is carrying VLAN 10 and VLAN 20, it’s time to prepare the router.
This is the crucial part of Router-on-a-Stick: you will create one logical interface per VLAN, each with its own encapsulation and IP address.40 % Complete: you’re making great progress
Unlock Premium to get the rest of this lesson
If you want to keep going with your CCNA journey, unlock your all-in-one platform to get ready for the CCNA exam.
Access all CCNA lessons
Practice with hands-on labs
Train with Practice exams and Quizzes
Progress tracking in your dashboard
Made by network engineers - CCNP certified
Unlock Premium1151 learners continued their CCNA journey this month