Configuring VLANs, Trunking, and Inter-VLAN Routing (Router-on-a-Stick)
The objective of this lab is to configure VLANs on a switch, establish trunking between the switch and router, and implement inter-VLAN routing using the Router-on-a-Stick method. This will allow hosts in different VLANs (VLAN 10 and VLAN 20) to communicate through the router acting as their default gateway.
In this lab, VLAN 10 and VLAN 20 were created on the switch and assigned to specific ports for host connections. Since VLANs are isolated by default, trunking was configured on the switch’s GigabitEthernet interface to carry multiple VLANs to the router. On the router, subinterfaces were created using 802.1Q encapsulation, with each subinterface assigned as the default gateway for its VLAN. This Router-on-a-Stick configuration enabled communication between devices in VLAN 10 and VLAN 20, demonstrating the importance of inter-VLAN routing in segmented networks.
PC0 (FA0/1) --- Switch (FA0/1 → VLAN 10)
PC1 (FA0/2) --- Switch (FA0/2 → VLAN 20)
Switch (G0/1 trunk) --- Router (G0/0)
Router (G0/0.10) → VLAN 10 Gateway (192.168.10.1)
Router (G0/0.20) → VLAN 20 Gateway (192.168.20.1)