Objective
A Virtual Local Area Network (VLAN) is a network virtualization technique that allows a Layer 2 switch to operate as multiple virtual switches. Each VLAN isolates its traffic from other VLANs, meaning devices on one VLAN cannot communicate with devices on another VLAN unless a router or Layer 3 switch is used to route traffic between them. This process is known as inter-VLAN routing.
In this lab, I will configure inter-VLAN routing in Cisco Packet Tracer using a router-on-a-stick setup. A trunk connection has already been established between Switch1 and Switch2, and their access ports are pre-configured. Additionally, Switch1 and Switch2 have been set up so that Sales1 and Sales2 communicate over VLAN 10, while HR1 and HR2 communicate over VLAN 20.
Network Topology:

Here is the IP addresses I used for this lab:
Device | Interface | IP Address | Subnet Mask | Default Gateway |
---|
Router1 | FastEthernet 0/0.10 | 192.168.10.1 | 255.255.255.192 | N/A |
Router1 | FastEthernet 0/0.20 | 192.168.20.1 | 255.255.255.192 | N/A |
Sales1 | N/A | 192.168.10.11 | 255.255.255.192 | 192.168.10.1 |
Sales2 | N/A | 192.168.10.12 | 255.255.255.192 | 192.168.10.1 |
HR1 | N/A | 192.168.20.11 | 255.255.255.192 | 192.168.20.1 |
HR2 | N/A | 192.168.20.12 | 255.255.255.192 | 192.168.20.1 |
- On Switch1, I configured the FastEthernet 0/11 interface as a trunk port. This configuration will disable negotiation and enforce the use of 802.1Q encapsulation:

switchport trunk encapsulation dot1q” command wont work on this Cisco 2960 switch in Packet Tracer likely because newer 2960 models only support 802.1q encapsulation by default, meaning you don’t need to explicitly set it.
Switch1(config-if)#switchport trunk encapsulation dot1q
2. On Router1, I enabled the physical interface. I then configured the following commands to create a subinterface for VLAN 10 and VLAN20 using ROAS, enter the encapsulation dot1q command for VLAN10 and VLAN20, and specify IP addresses for both VLANS:

3. On Router 1, I verified InterVLAN routing using the show ip route command, and pings between VLANS from each laptop client. Pings from each device to one another are all successful.




