Inter-VLAN routing (router-on-a-stick)

Practise this lab in the free NanoTech-kw Network Lab - a Cisco-style simulator that runs in your browser, with hints, an event log and automatic checking.

โ–ถ Open the free Network Lab

Devices: R1, SW1, PC1, PC2, PC3, PC4

Your task

Task: route between VLAN 10 and VLAN 20 on one router port.
 SW1: int g0/1 โ†’ switchport mode trunk
 R1: int g0/0 โ†’ no shut
     int g0/0.10 โ†’ encapsulation dot1Q 10 โ†’ ip add 192.168.10.1 255.255.255.0
     int g0/0.20 โ†’ encapsulation dot1Q 20 โ†’ ip add 192.168.20.1 255.255.255.0

Step by step

  1. Make SW1's port to R1 (G0/1) a trunk.
  2. Turn on R1 G0/0 (the physical port).
  3. Create G0/0.10 (dot1Q 10) with 192.168.10.1/24.
  4. Create G0/0.20 (dot1Q 20) with 192.168.20.1/24.
  5. PC1 (VLAN 10) pings PC3 (192.168.20.11).

โ–ถ Start this lab in the browser๐Ÿ“– Command guide๐Ÿงญ Watch how IP routing works

More labs

Two PCs on a switchRouter between two networksVLANs on a switchStatic routingLayer-3 switch with SVIsDHCP server on a routerDHCP server + relay + DNSOSPF between three routersRIP v2NAT/PAT to the InternetACL: protect a serverWireless access pointIPv6 static routingEIGRP between three routersProject: build a small office networkHuawei switch VLANs + Cisco routerOSPF between Huawei and Cisco routersSpanning Tree: who blocks?EtherChannel (LACP)HSRP: a gateway that never diesPort securitySecure remote access (SSH)To the Internet: NAT + DNS + webIPv6 SLAAC + OSPFv3๐Ÿ”ง Fix 1: PC can't leave its network๐Ÿ”ง Fix 2: same VLAN, no ping๐Ÿ”ง Fix 3: one-way routing๐Ÿ”ง Fix 4: inter-VLAN broken๐Ÿ”ง Fix 5: odd subnet problem