TP2 - Inter-VLAN Routing (Router-on-a-Stick) Lab Solution
Lab Objectives
1. Configure Inter-VLAN routing using Router-on-a-Stick method
2. Test Inter-VLAN communication
3. Examine VLAN tag changes at the router level using simulation mode
Network Topology Setup in Packet Tracer
Required Equipment
1 Router (2911 or similar)
2 Switches (2960 or similar)
5 PCs
Ethernet cables
Physical Connections
1. Router DGW G0/0 ↔ Sw_Etage2 G0/1 (Trunk link)
2. Sw_Etage2 G0/2 ↔ Sw_Etage1 G0/2 (Trunk link)
3. PC1 → Sw_Etage1 F0/1
4. PC2 → Sw_Etage1 F0/2
5. PC3 → Sw_Etage1 F0/3
6. PC4 → Sw_Etage2 F0/4
7. PC5 → Sw_Etage2 F0/5
IP Addressing Table
Device Interface IP Address Subnet Mask Default Gateway
Sw_Etage1 SVI VLAN99 [Link] [Link] [Link]
Sw_Etage2 SVI VLAN99 [Link] [Link] [Link]
PC1 Fa0 [Link] [Link] [Link]
PC2 Fa0 [Link] [Link] [Link]
PC3 Fa0 [Link] [Link] [Link]
PC4 Fa0 [Link] [Link] [Link]
PC5 Fa0 [Link] [Link] [Link]
VLAN Assignment
VLAN 10: Teachers (PC1, PC3, PC5)
VLAN 20: Students (PC2, PC4)
VLAN 80: Native VLAN (for trunk links)
VLAN 99: Management VLAN (for switch management)
Part 1: Basic Device Configuration
Step 1: Configure Switches
A. Configure Sw_Etage1
cisco
Switch>enable
Switch#configure terminal
Switch(config)#hostname Sw_Etage1
! Create VLANs
Sw_Etage1(config)#vlan 10
Sw_Etage1(config-vlan)#name Teachers
Sw_Etage1(config-vlan)#vlan 20
Sw_Etage1(config-vlan)#name Students
Sw_Etage1(config-vlan)#vlan 80
Sw_Etage1(config-vlan)#name Native
Sw_Etage1(config-vlan)#vlan 99
Sw_Etage1(config-vlan)#name Management
Sw_Etage1(config-vlan)#exit
! Assign ports to VLANs
Sw_Etage1(config)#interface fa0/1
Sw_Etage1(config-if)#switchport mode access
Sw_Etage1(config-if)#switchport access vlan 10
Sw_Etage1(config-if)#interface fa0/2
Sw_Etage1(config-if)#switchport mode access
Sw_Etage1(config-if)#switchport access vlan 20
Sw_Etage1(config-if)#interface fa0/3
Sw_Etage1(config-if)#switchport mode access
Sw_Etage1(config-if)#switchport access vlan 10
! Configure trunk to Sw_Etage2
Sw_Etage1(config)#interface g0/2
Sw_Etage1(config-if)#switchport mode trunk
Sw_Etage1(config-if)#switchport trunk native vlan 80
! Configure management interface
Sw_Etage1(config)#interface vlan 99
Sw_Etage1(config-if)#ip address [Link] [Link]
Sw_Etage1(config-if)#no shutdown
! Set default gateway
Sw_Etage1(config)#ip default-gateway [Link]
B. Configure Sw_Etage2
cisco
Switch>enable
Switch#configure terminal
Switch(config)#hostname Sw_Etage2
! Create VLANs
Sw_Etage2(config)#vlan 10
Sw_Etage2(config-vlan)#name Teachers
Sw_Etage2(config-vlan)#vlan 20
Sw_Etage2(config-vlan)#name Students
Sw_Etage2(config-vlan)#vlan 80
Sw_Etage2(config-vlan)#name Native
Sw_Etage2(config-vlan)#vlan 99
Sw_Etage2(config-vlan)#name Management
Sw_Etage2(config-vlan)#exit
! Assign ports to VLANs
Sw_Etage2(config)#interface fa0/4
Sw_Etage2(config-if)#switchport mode access
Sw_Etage2(config-if)#switchport access vlan 20
Sw_Etage2(config-if)#interface fa0/5
Sw_Etage2(config-if)#switchport mode access
Sw_Etage2(config-if)#switchport access vlan 10
! Configure trunk to router
Sw_Etage2(config)#interface g0/1
Sw_Etage2(config-if)#switchport mode trunk
Sw_Etage2(config-if)#switchport trunk native vlan 80
! Configure trunk to Sw_Etage1
Sw_Etage2(config)#interface g0/2
Sw_Etage2(config-if)#switchport mode trunk
Sw_Etage2(config-if)#switchport trunk native vlan 80
! Configure management interface
Sw_Etage2(config)#interface vlan 99
Sw_Etage2(config-if)#ip address [Link] [Link]
Sw_Etage2(config-if)#no shutdown
! Set default gateway
Sw_Etage2(config)#ip default-gateway [Link]
Step 2: Configure PC IP Addresses
Configure each PC with the following settings:
PC1 (Teacher)
IP Address: [Link]
Subnet Mask: [Link]
Default Gateway: [Link]
PC2 (Student)
IP Address: [Link]
Subnet Mask: [Link]
Default Gateway: [Link]
PC3 (Teacher)
IP Address: [Link]
Subnet Mask: [Link]
Default Gateway: [Link]
PC4 (Student)
IP Address: [Link]
Subnet Mask: [Link]
Default Gateway: [Link]
PC5 (Teacher)
IP Address: [Link]
Subnet Mask: [Link]
Default Gateway: [Link]
Part 2: Router-on-a-Stick Configuration
Configure Router DGW
cisco
Router>enable
Router#configure terminal
Router(config)#hostname DGW
! Configure subinterface for VLAN 99 (Management)
DGW(config)#interface g0/0.99
DGW(config-subif)#encapsulation dot1q 99
DGW(config-subif)#ip address [Link] [Link]
! Configure subinterface for VLAN 10 (Teachers)
DGW(config)#interface g0/0.10
DGW(config-subif)#encapsulation dot1q 10
DGW(config-subif)#ip address [Link] [Link]
! Configure subinterface for VLAN 20 (Students)
DGW(config)#interface g0/0.20
DGW(config-subif)#encapsulation dot1q 20
DGW(config-subif)#ip address [Link] [Link]
! Activate the physical interface
DGW(config)#interface g0/0
DGW(config-if)#no shutdown
Part 3: Verification and Testing
Step 1: Verify Configuration
Check Switch Configuration
cisco
! On both switches
Sw_Etage1#show vlan brief
Sw_Etage1#show interfaces trunk
Sw_Etage1#show running-config
Check Router Configuration
cisco
DGW#show ip interface brief
DGW#show running-config
Step 2: Connectivity Tests
1. Test Inter-VLAN Communication:
Ping from PC1 (VLAN 10) to PC2 (VLAN 20)
Ping from PC3 (VLAN 10) to PC4 (VLAN 20)
These should be successful due to router configuration
2. Test Intra-VLAN Communication:
Ping from PC1 to PC3 (both in VLAN 10)
Ping from PC2 to PC4 (both in VLAN 20)
These should be successful
Part 4: VLAN Tag Examination (Simulation Mode)
Steps to Examine VLAN Tag Changes:
1. Switch to Simulation Mode in Packet Tracer
2. Filter Protocol: Select only ICMPv4
3. Send Ping: From PC1 to PC2
4. Step Through Simulation: Click "Auto Capture/Play" or step through manually
Expected Behavior:
Frame Analysis at Each Point:
1. PC1 → Sw_Etage1:
Untagged Ethernet II frame
2. Sw_Etage1 → Sw_Etage2:
802.1Q tagged frame with VLAN ID 10 (0x000A in hex)
3. Sw_Etage2 → Router DGW:
802.1Q tagged frame with VLAN ID 10 maintained
4. Router DGW → Sw_Etage2:
TAG CHANGE: 802.1Q tagged frame with VLAN ID 20 (0x0014 in hex)
Router changes the VLAN tag from 10 to 20
5. Sw_Etage2 → Sw_Etage1:
802.1Q tagged frame with VLAN ID 20 maintained
6. Sw_Etage1 → PC2:
Tag removed, untagged Ethernet II frame delivered to PC2
Troubleshooting Tips
Common Issues and Solutions:
1. No Inter-VLAN Communication:
Verify router subinterfaces are configured correctly
Check that physical interface G0/0 is enabled ( no shutdown )
Ensure trunk ports are configured with correct native VLAN
2. Trunk Not Working:
Verify both sides of trunk link are configured as trunk
Check native VLAN matches on both sides
Use show interfaces trunk to verify
3. PC Cannot Ping Gateway:
Verify PC IP configuration
Check VLAN assignment on switch ports
Ensure router subinterface IP matches PC gateway
Verification Commands:
cisco
! Switch commands
show vlan brief
show interfaces trunk
show interfaces switchport
show mac address-table
! Router commands
show ip interface brief
show ip route
show interfaces
Lab Completion Checklist
All VLANs created on both switches
Ports assigned to correct VLANs
Trunk links configured with native VLAN 80
Router subinterfaces configured for each VLAN
PC IP addresses configured correctly
Inter-VLAN ping tests successful
Simulation mode shows VLAN tag changes at router
All devices can communicate as expected
This completes the Inter-VLAN routing lab using the Router-on-a-Stick method!