National Textile University, Faisalabad
Department of Computer Science
Course: Data Communication and Networks (COC-2077_DCN)
Lab Report No.: 08
Topic: Inter-VLAN Routing using Router-on-a-Stick
Submitted To: Sir Abid Hussain
Submitted By: Sara Khalid, Eshal Fatima, Minahil Tahir
Semester: 3rd
Program: BS Artificial Intelligence
Date of Submission: November 2025
1. Objective
The objective of this lab is to configure Inter-VLAN Routing using the Router-on-a-Stick
method. This technique enables communication between devices located in different VLANs
by utilizing a single router interface with multiple sub-interfaces. The experiment
demonstrates how VLAN segmentation enhances network organization and how a router
facilitates traffic routing between them.
2. Devices and Software Used
1 Router (Cisco 2811)
1 Switch (Cisco 2960)
2 PCs
Copper Straight-through Cables
Cisco Packet Tracer Software
3. Network Topology Overview
In this lab, a star topology was implemented in Cisco Packet Tracer, connecting two PCs to a
single switch and linking that switch to a router. Each PC was assigned to a separate VLAN
as shown below:
Device VLAN IP Address Subnet Mask Default
Gateway
PC1 VLAN 10 [Link] [Link] [Link]
PC2 VLAN 20 [Link] [Link] [Link]
Router VLAN 10 [Link] [Link] —
(Fa0/0.10)
Router VLAN 20 [Link] [Link] —
(Fa0/0.20)
4. Concepts Involved
VLAN (Virtual Local Area Network): A VLAN divides a single physical network into multiple
logical networks. Each VLAN acts as a separate broadcast domain, improving security and
reducing traffic congestion.
Inter-VLAN Routing: Normally, devices in different VLANs cannot communicate. Inter-VLAN
Routing allows these devices to exchange data through a router configured to route traffic
between VLANs.
Router-on-a-Stick: This method involves using a single physical router interface configured
with multiple sub-interfaces, each representing a different VLAN. It’s an efficient and cost-
effective way to enable Inter-VLAN communication.
5. Procedure
1. Step 1: Designing the Network
Two PCs were connected to a switch. The switch was connected to the router using a Gigabit
Ethernet cable. The router was configured to handle multiple VLANs via sub-interfaces.
2. Step 2: Configuring VLANs on the Switch
Switch> enable
Switch# configure terminal
Switch(config)# vlan 10
Switch(config-vlan)# name VLAN10
Switch(config-vlan)# exit
Switch(config)# vlan 20
Switch(config-vlan)# name VLAN20
Switch(config-vlan)# exit
3. Step 3: Assigning Ports to VLANs
Switch(config)# interface fastEthernet0/1
Switch(config-if)# switchport mode access
Switch(config-if)# switchport access vlan 10
Switch(config-if)# exit
Switch(config)# interface fastEthernet0/2
Switch(config-if)# switchport mode access
Switch(config-if)# switchport access vlan 20
Switch(config-if)# exit
4. Step 4: Configuring the Trunk Port
Switch(config)# interface gigabitEthernet0/1
Switch(config-if)# switchport mode trunk
Switch(config-if)# switchport trunk allowed vlan 10,20
Switch(config-if)# exit
5. Step 5: Router Configuration
Router> enable
Router# configure terminal
Router(config)# interface fastEthernet0/0
Router(config-if)# no shutdown
Router(config-if)# exit
Router(config)# interface fastEthernet0/0.10
Router(config-subif)# encapsulation dot1Q 10
Router(config-subif)# ip address [Link] [Link]
Router(config)# interface fastEthernet0/0.20
Router(config-subif)# encapsulation dot1Q 20
Router(config-subif)# ip address [Link] [Link]
Router(config-subif)# exit
6. Step 6: Configuring PCs
PC1: IP [Link], Subnet [Link], Gateway [Link]
PC2: IP [Link], Subnet [Link], Gateway [Link]
7. Step 7: Verification and Testing
Switch# show vlan brief
Router# show ip interface brief
PC1> ping [Link] — Successful communication confirmed.
6. Purpose and Role of the Router
The router operates at Layer 3 of the OSI model. It connects multiple networks and routes
packets between them using IP addresses. In this lab, it performs Inter-VLAN Routing,
enabling communication between VLAN 10 and VLAN 20. It provides default gateways for
devices in each VLAN and uses sub-interfaces with 802.1Q encapsulation to identify VLAN
traffic.
7. Key Cisco Commands and Their Functions
Command Function
configure terminal Enter configuration mode
vlan 10 / vlan 20 Create VLANs
switchport mode access Configure access mode for a port
switchport access vlan X Assign VLAN to port
switchport mode trunk Enable trunking
switchport trunk allowed vlan 10,20 Allow VLANs on trunk
encapsulation dot1Q X Enable 802.1Q tagging for VLAN
show vlan brief Display VLAN information
show ip interface brief Display router interface details
no shutdown Activate router interface
8. Conclusion
This lab successfully demonstrated Inter-VLAN Routing using the Router-on-a-Stick
method. All configurations were verified using Cisco commands, and successful ping results
confirmed communication between VLANs. The experiment highlights the importance of
routers in managing multiple networks efficiently and shows how VLANs enhance network
segmentation, performance, and security. Thus, the network was fully operational, with
effective routing and proper interconnectivity between VLANs 10 and 20.