Networking guides, explanations and reader checklists on whilenetworking.com

Packet Tracer Lab: Configure a Multi-VLAN Router-on-a-Stick Architecture with Inter-VLAN Routing

In modern enterprise networking, separating traffic into logical groups is essential for security and performance. This lab guides you through building a …

In modern enterprise networking, separating traffic into logical groups is essential for security and performance. This lab guides you through building a Router-on-a-Stick architecture using Cisco Packet Tracer. This configuration allows a single physical router interface to handle routing between multiple VLANs by utilizing Sub-interface trunking. We will cover the complete process, from planning subnets to verifying connectivity with DNS and DHCP services.

Understanding the Router-on-a-Stick Concept

Before configuring devices, it is crucial to understand the topology. A Router-on-a-Stick design uses one physical router interface connected to a switch port configured as a trunk. The router creates multiple logical sub-interfaces (e.g., Gig0/0.10, Gig0/0.20) corresponding to each VLAN ID. Each sub-interface is assigned an IP address that serves as the default gateway for its respective VLAN subnet.

This approach is cost-effective for small to medium-sized networks where deploying a Layer 3 switch or multiple physical router interfaces is unnecessary. However, it introduces complexity in configuration and potential bottlenecks if the single interface becomes saturated.

Prerequisites and Topology Planning

To ensure success, you must plan your IP addressing scheme before opening Packet Tranger. Assume a standard Class C network (e.g., 192.168.0.0/24) is available. You will need to allocate subnets for at least two VLANs, such as VLAN 10 for HR and VLAN 20 for Sales.

Required Components:
* Cisco Router: Any model with a Gigabit Ethernet interface (e.g., 1941 or 2811).
* Cisco Catalyst Switch: A Layer 2 switch supporting trunking (e.g., 2960).
* End Devices: PCs for each VLAN, configured to obtain IP settings via DHCP.
* Software: Cisco Packet Tracer (v7.x or later) and optionally Wireshark for traffic analysis.

Subnetting Plan Example:
* VLAN 10 (HR): Network 192.168.10.0/24, Gateway 192.168.10.1
* VLAN 20 (Sales): Network 192.168.20.0/24, Gateway 192.168.20.1
* Router Interface: GigabitEthernet0/0 will be split into sub-interfaces .10 and .20.

Step-by-Step Configuration Guide

Configuring the Switch Trunk Port

Start by connecting the router interface to a switch port. On the switch, configure the physical port as a trunk to carry traffic for multiple VLANs.

Switch> enable
Switch# configure terminal
Switch(config)# interface GigabitEthernet1/0/1
Switch(config-if)# switchport mode trunk
Switch(config-if)# switchport trunk allowed vlan 10,20
Switch(config-if)# exit

Explanation: The switchport mode trunk command enables the port to accept tagged frames from multiple VLANs. The allowed vlan command restricts traffic to only the VLANs you intend to use, enhancing security.

Creating Sub-Interfaces on the Router

Next, enter global configuration mode on the router and create sub-interfaces. Each sub-interface represents a logical connection for a specific VLAN.

Router> enable
Router# configure terminal
Router(config)# interface GigabitEthernet0/0.10
Router(config-subif)# encapsulation dot1Q 10
Router(config-subif)# ip address 192.168.10.1 255.255.255.0
Router(config-subif)# exit

Router(config)# interface GigabitEthernet0/0.20
Router(config-subif)# encapsulation dot1Q 20
Router(config-subif)# ip address 192.168.20.1 255.255.255.0

Explanation: The encapsulation dot1Q <vlan-id> command applies the IEEE 802.1Q tagging standard to the sub-interface, associating it with a specific VLAN ID. The ip address command assigns the gateway IP for that subnet. Do not forget to configure the physical interface GigabitEthernet0/0 itself as no-IP (usually default) or ensure it is not conflicting with sub-interfaces.

Configuring DHCP and DNS Services

For a realistic workplace scenario, end devices should not be manually configured. Enable the DHCP service on the router to automatically assign IP addresses, subnet masks, gateways, and DNS servers.

Router(config)# ip dhcp pool VLAN10_POOL
Router(dhcp-config)# network 192.168.10.0 255.255.255.0
Router(dhcp-config)# default-router 192.168.10.1
Router(dhcp-config)# dns-server 8.8.8.8
Router(dhcp-config)# exit

Router(config)# ip dhcp pool VLAN20_POOL
Router(dhcp-config)# network 192.168.20.0 255.255.255.0
Router(dhcp-config)# default-router 192.168.20.1
Router(dhcp-config)# dns-server 8.8.8.8

Explanation: The ip dhcp pool command creates a separate pool for each VLAN to prevent IP address conflicts. The default-router must match the sub-interface IP configured earlier. Using a public DNS like 8.8.8.8 (Google) or 1.1.1.1 (Cloudflare) ensures name resolution works across the internet.

Verifying Connectivity and Troubleshooting

Once configuration is complete, verify the setup using Packet Tracer’s simulation mode or command-line verification tools.

Verification Steps:
1. Check Interface Status: On the router, run show ip interface brief. Ensure sub-interfaces show “up/up”.
2. Test Ping: From a PC in VLAN 10, ping the gateway (192.168.10.1). Then ping an IP in VLAN 20 (e.g., 192.168.20.5). Success indicates inter-VLAN routing is working.
3. Wireshark Analysis: If running Wireshark on a promiscuous mode device, capture packets to verify the presence of 802.1Q tags (e.g., VLAN ID: 10) in the Ethernet header.

Expected Output Example:

Type escape sequence to abort.
Testing connectivity to 192.168.20.5...
Success rate is defined as the percentage of packets that were received successfully.
Success rate is 100 percent (1/1)

Common Errors and Fixes

Students often encounter specific issues during this lab:
* Error: “Ping failed” between VLANs.
* Fix: Check if the switch port is actually a trunk (show interfaces trunk). If it shows “not in use” or only allows VLAN 1, add the missing VLANs to the allowed vlan list.
* Error: DHCP clients receive incorrect gateways.
* Fix: Verify that the DHCP pool network statement matches the subnet exactly and that the default-router IP matches the sub-interface IP.
* Error: “Layer 1 or Layer 2 protocol down.”
* Fix: Ensure the physical cable is connected and the router’s main interface (GigabitEthernet0/0) is not administratively shut down (no shutdown).

Industry Application and Student Practice Task

In real-world scenarios, this architecture is often used in branch offices where a central site routes traffic between departments via a single WAN link back to headquarters. While Layer 3 switches are common today, the Router-on-a-Stick model remains relevant for legacy equipment or cost-constrained deployments.

Student Practice Task:
Expand the lab by adding a third VLAN (VLAN 30) for a “Guest” network. Configure Access Control Lists (ACLs) to allow Guest users to access the internet but block them from accessing internal HR or Sales networks. This reinforces security concepts alongside routing fundamentals.

Conclusion

Configuring a multi-VLAN Router-on-a-Stick architecture requires careful planning of subnets and precise application of encapsulation commands. By following these steps, you can create a functional network that isolates traffic while maintaining connectivity between departments. Remember to always verify your configuration with ping tests and packet captures before deploying changes in a live production environment.

Educational-use notice: This tutorial is for learning and controlled lab use only. Test carefully, use backups, and obtain authorization before making changes. Do not run unfamiliar commands on production systems. We accept no responsibility for misuse, damage, data loss, or production issues.