Lab 1 proved VLANs isolate traffic at Layer 2. Lab 2 adds the next piece — a router that sits above those VLANs and routes between them in a controlled way. This is the classic router-on-a-stick topology: one physical router interface, multiple logical subinterfaces, each one handling a different VLAN.
The lab has two parts. Part 1 is the same VLAN configuration from Lab 1 — build it from scratch again, practice makes it automatic. Part 2 adds a third switch and a router, configures dot1q subinterfaces, and routes between the Student and Staff subnets.
[ ⚠ LAST USABLE ADDRESS = DEFAULT GATEWAY ]
Students subnet 192.168.10.0/25 — last usable is .126 (.127 is broadcast)
Staff subnet 192.168.10.128/25 — last usable is .254 (.255 is broadcast)
These become the subinterface IPs on R1 and the default gateways on each PC.
▶ PART 1 — VLAN SEGMENTATION
Same foundation as Lab 1. Build VLANs, assign access ports, set up the trunk. The difference here is a third switch (SW3) acting as the distribution layer between the two access switches and the router.
STEP 1 — CREATE VLANS (ALL THREE SWITCHES)
! Run on SW1, SW2, and SW3
Switch(config)# vlan 10
Switch(config-vlan)# name Students
Switch(config)# vlan 100
Switch(config-vlan)# name Staff
Switch(config)# vlan 99
Switch(config-vlan)# name Native_Unused
STEP 2 — ACCESS PORTS ON SW1
! Use interface range to configure multiple ports at once
SW1(config)# interface range fa0/2 - 3
SW1(config-if-range)# switchport mode access
SW1(config-if-range)# switchport access vlan 10
SW1(config-if-range)# spanning-tree portfast
SW1(config)# interface fa0/4
SW1(config-if)# switchport mode access
SW1(config-if)# switchport access vlan 100
SW1(config-if)# spanning-tree portfast
! Run on BOTH SW1 and SW2 on their uplink ports (F0/1)
Switch(config)# interface fa0/1
Switch(config-if)# switchport mode trunk
Switch(config-if)# switchport trunk allowed vlan 10,100
Switch(config-if)# switchport trunk native vlan 99
STEP 5 — PART 1 VERIFICATION
Switch# show vlan brief
Switch# show interfaces trunk
[ CLICK TO REVEAL — PART 1 TASKS & VERIFICATION ]▶
TASK 1Create VLAN 10 (Students) and VLAN 100 (Staff) on SW1, SW2, and SW3. Use interface range where possible.
TASK 2On SW1 — Fa0/2 and Fa0/3 access VLAN 10, Fa0/4 access VLAN 100. Enable portfast on all access ports.
TASK 3On SW2 — Fa0/2 access VLAN 100, Fa0/3 and Fa0/4 access VLAN 10. Enable portfast on all access ports.
TASK 4Configure trunk between SW1 Fa0/1 and SW2 Fa0/1. Allow VLANs 10 and 100. Native VLAN 99 on both ends.
TASK 5 — PING TESTPing PC1 → PC6. Should succeed — both VLAN 10 Students.
TASK 6 — PING TESTPing PC1 → PC3. Should fail — VLAN 10 cannot reach VLAN 100 at Layer 2.
[ PART 1 EXPECTED RESULTS ]
PC1 → PC6: SUCCESS (VLAN 10 across trunk)
PC1 → PC3: FAIL (VLAN 10 → VLAN 100, no routing yet)
▶ PART 2 — INTER-VLAN ROUTING
Part 1 proved isolation. Part 2 breaks it — intentionally, with a router making the decisions about what can talk to what. The router connects to SW3, which trunks down to SW1 and SW2. One physical interface on R1 handles both VLANs using logical subinterfaces.
! Enable the physical interface first — no IP on the parent
R1(config)# interface g0/0/0
R1(config-if)# no shutdown
! Subinterface for VLAN 10 — Students
R1(config)# interface g0/0/0.10
R1(config-subif)# encapsulation dot1q 10
R1(config-subif)# ip address 192.168.10.126 255.255.255.128
! Subinterface for VLAN 100 — Staff
R1(config)# interface g0/0/0.100
R1(config-subif)# encapsulation dot1q 100
R1(config-subif)# ip address 192.168.10.254 255.255.255.128
[ ⚠ ENCAPSULATION BEFORE IP ADDRESS ]
The encapsulation dot1q command must come before the ip address command on every subinterface. If you set the IP first, IOS will accept it but the subinterface won't tag traffic correctly and routing will fail silently.
STEP 4 — ADD DEFAULT GATEWAYS TO PCS
! On each Student PC (VLAN 10) — set gateway to R1's .10 subinterface
Default Gateway: 192.168.10.126
! On each Staff PC (VLAN 100) — set gateway to R1's .100 subinterface
Default Gateway: 192.168.10.254
[ CLICK TO REVEAL — PART 2 TASKS & VERIFICATION ]▶
TASK 1Configure SW3 Fa0/0 as a trunk port. Allow VLANs 10 and 100. Native VLAN 99.
TASK 2Configure SW3 G0/1 and G0/2 as trunk ports toward SW1 and SW2. Same allowed VLANs and native VLAN.
TASK 3On R1, enable G0/0/0 with no shutdown. Create subinterface G0/0/0.10 with dot1q encapsulation for VLAN 10, IP 192.168.10.126/25. Create G0/0/0.100 with dot1q encapsulation for VLAN 100, IP 192.168.10.254/25.
TASK 4Add default gateways to all PCs. Students (PC1, PC2, PC5, PC6) → 192.168.10.126. Staff (PC3, PC4) → 192.168.10.254.
TASK 5 — PING TESTPing between all subnets. Every PC should be able to reach every other PC now that the router is routing between VLANs.
[ PART 2 EXPECTED RESULTS ]
PC1 → PC3: SUCCESS (routed via R1)
PC1 → PC4: SUCCESS (routed via R1)
PC2 → PC3: SUCCESS (routed via R1)
PC5 → PC4: SUCCESS (routed via R1)
PC6 → PC3: SUCCESS (routed via R1)
All same-VLAN pings: SUCCESS
⬇ LAB 2 — INTER-VLAN ROUTING v2.0Topology pre-built. PCs pre-configured with IPs. Switches and router unconfigured — your job.
Get the full IPv4 subnetting cheat sheet — every prefix /8 to /32 with subnet mask, block size, host counts, and wildcard mask — the moment you subscribe. Then new labs and articles as they drop. No spam. Unsubscribe any time.