In modern enterprise networking, segmentation is critical for security and performance. However, simply dividing a network into Virtual Local Area Networks (VLANs) often results in isolated silos where devices in different segments cannot communicate. To resolve this while maintaining logical separation, engineers must implement Inter-VLAN routing. This hands-on lab guides you through configuring VLAN trunking using the IEEE 802.1Q standard and implementing routing protocols on a multi-layer switch environment. We will utilize Cisco Packet Tracer for simulation, focusing on practical command-line interface (CLI) usage, verification techniques with tools like Wireshark logic, and troubleshooting common configuration errors.
Prerequisites and Topology Design
Before initiating the configuration, ensure you have access to Cisco Packet Tracer or a GNS3/Eve-NG environment running compatible IOS versions (e.g., Catalyst 2960-X or 3850). This lab assumes a standard three-tier design logic simplified for learning: two access switches connected to a core multi-layer switch.
Lab Goals:
1. Create VLANs 10 and 20 on the switches.
2. Configure Switch-to-Switch links as 802.1Q trunks.
3. Enable routing between VLANs using either Single-Arouted-Interface (Router-on-a-Stick) logic or Layer 3 Switching (SVI).
4. Verify connectivity and inspect packet tags.
Required Tools:
* Cisco Packet Tracer.
* Conceptual understanding of subnetting (e.g., /24 networks for VLAN 10, /24 for VLAN 20).
* Basic familiarity with DHCP and DNS services to ensure hosts receive correct IP addresses before routing tests.
Configuring Access Ports and Creating VLANs
The foundation of any segmented network is the creation of VLANs on the switch databases. In our topology, we will assign PC-A to VLAN 10 (Sales) and PC-B to VLAN 20 (Engineering).
First, access the CLI of your distribution or core multi-layer switch. Enter global configuration mode and define the VLANs:
Switch> enable
Switch# configure terminal
Switch(config)# vlan 10
Switch(config-vlan)# name SALES
Switch(config-vlan)# exit
Switch(config)# vlan 20
Switch(config-vlan)# name ENGINEERING
Switch(config-vlan)# exit
Next, you must assign specific physical interfaces to these VLANs. For example, connect a PC to interface GigabitEthernet0/1 and configure it as an access port:
Switch(config)# interface GigabitEthernet0/1
Switch(config-if)# switchport mode access
Switch(config-if)# switchport access vlan 10
Switch(config-if)# exit
Repeat this process for the second PC, assigning GigabitEthernet0/2 to VLAN 20. At this stage, devices within the same VLAN can communicate, but traffic between VLANs is blocked by default due to Layer 2 isolation.
Establishing 802.1Q Trunk Links
To allow a multi-layer switch to route between these VLANs efficiently, the link connecting it to other switches (or routers) must carry multiple VLAN tags simultaneously. This requires configuring an 802.1Q trunk. Unlike access ports which carry untagged traffic for a single VLAN, trunk ports expect and send tagged frames.
Identify the interface connecting your distribution switch to the core multi-layer switch (e.g., GigabitEthernet0/47). Configure it as follows:
Switch(config)# interface GigabitEthernet0/47
Switch(config-if)# switchport mode trunk
Switch(config-if)# switchport trunk encapsulation dot1q
Switch(config-if)# switchport trunk allowed vlan 10,20
Switch(config-if)# exit
The command switchport trunk allowed vlan 10,20 restricts the trunk to only carry traffic for VLANs 10 and 20, enhancing security by preventing unauthorized VLAN hopping attempts via other IDs. The encapsulation command is often redundant on newer IOS versions but remains essential in legacy environments or specific Packet Tracer simulations.
Enabling Inter-VLAN Routing
Once the physical and logical topology is established, we must enable routing. There are two primary methods: using a dedicated router (Router-on-a-Stick) or utilizing Switch Virtual Interfaces (SVIs) on the multi-layer switch itself. For this lab, we will demonstrate the SVI method, which is standard for modern Layer 3 switches.
Enter configuration mode on the multi-layer switch to create virtual interfaces for each VLAN. These SVIs act as the default gateway for devices in those respective VLANs:
Switch(config)# interface Vlan10
Switch(config-if)# ip address 192.168.10.1 255.255.255.0
Switch(config-if)# no shutdown
Switch(config)# interface Vlan20
Switch(config-if)# ip address 192.168.20.1 255.255.255.0
Switch(config-if)# no shutdown
After creating the SVIs, ensure IP routing is enabled globally:
Switch(config)# ip routing
Without ip routing, the switch will treat these interfaces as Layer 2 bridges even if they have IP addresses assigned. With this enabled, the switch can now forward packets between VLAN 10 and VLAN 20.
Verification and Troubleshooting with Wireshark Logic
Configuration alone is insufficient; verification is crucial to ensure traffic flows correctly. You should verify that PCs in different VLANs can ping each other. If pings fail, proceed to logical troubleshooting steps.
Step 1: Check Interface Status
Ensure the SVIs and trunk links are up/up. Use show ip interface brief to confirm no interfaces are administratively down or physically down.
Step 2: Inspect Trunk Negotiation
Run show interfaces trunk to verify that the expected VLANs (10 and 20) appear in the “Allowed VLANs” list and that the native VLAN matches on both ends of the link. Mismatched native VLANs are a common cause of packet loss or security vulnerabilities.
Step 3: Analyze Packet Tags
In a real-world scenario, you would connect a port mirroring session to a Wireshark analyzer. In Packet Tracer, use the “Simulation” mode and drag a protocol analyzer onto the link between the switch and the router/destination. Click on the link to see captured packets. You should observe frames tagged with 802.1Q headers containing the VLAN ID. If you see untagged traffic on a trunk port intended for specific VLANs, the encapsulation or allowed list configuration is incorrect.
Common Errors and Fixes:
* Error: “Destination Host Unreachable.”
* Cause: The destination VLAN does not exist on the routing switch, or the SVI is down.
* Fix: Verify show vlan brief to ensure VLANs exist and no shutdown is applied to the SVI.
* Error: Native VLAN Mismatch.
* Cause: One side defaults to VLAN 1 while the other is configured for a different native VLAN.
* Fix: Explicitly set the native VLAN on both ends: switchport trunk native vlan 99.
Student Practice Task and Industry Application
To reinforce these concepts, students should perform the following practice task: Create a scenario with three VLANs (10, 20, and 30). Configure a router-on-a-stick setup using sub-interfaces on a physical router interface connected to a trunk. Assign IP addresses 192.168.10.1, 192.168.20.1, and 192.168.30.1 to the sub-interfaces encapsulated in 802.1Q. Verify that a host in VLAN 10 can reach a server in VLAN 30 via the router.
In an industry application, this architecture supports security policies where HR (VLAN 10) cannot directly access Development servers (VLAN 20) without passing through a firewall or specific routing rules. By mastering 802.1Q trunking and SVI configuration, engineers can build scalable backbones that support hundreds of VLANs while maintaining strict logical boundaries. Always remember to verify policy terms with authoritative sources like IEEE standards documents for the latest protocol updates regarding tagging efficiency and security enhancements like 802.1X integration on trunks.
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.

