Router-on-a-stick

NetLab lab Intermediate 4 tasks 20 points

SW1 already has VLAN 10 (PC1, 192.168.10.0/24) and VLAN 20 (PC2, 192.168.20.0/24). Let them talk through R1 using one cable: R1 Gi0/0 to SW1 Gi0/1.

  • R1 Gi0/0.10: VLAN 10, 192.168.10.1/24
  • R1 Gi0/0.20: VLAN 20, 192.168.20.1/24

How it works: this is VulnTech NetLab, a network simulator running in your browser. Click a device in the diagram to open its console and type commands, just like on real equipment (? shows help, Tab finishes a word). Click a cable to inspect it. Tasks tick themselves off as you complete them; questions are answered in the box under each task. Your work is kept if you reload; Reset starts the network over.

Solution explanation

The trunk carries both VLANs tagged to R1. Each subinterface accepts one VLAN's tag and is that VLAN's gateway. The physical port needs no shutdown, or every subinterface stays down. PC2 starts its replies at TTL 64 and R1 takes one off, so PC1 sees 63.

Show solution
[SW1]
enable
configure terminal
interface g0/1
switchport mode trunk
end
[R1]
enable
configure terminal
interface g0/0
no shutdown
interface g0/0.10
encapsulation dot1Q 10
ip address 192.168.10.1 255.255.255.0
interface g0/0.20
encapsulation dot1Q 20
ip address 192.168.20.1 255.255.255.0
end
[PC1]
ping 192.168.20.10
[PC2]
ping -c 3 192.168.10.10
HOME LABS COMMUNITY DASHBOARD