Practice

Step-by-Step VLAN Lab (Packet Tracer)

Your turn. Build this network in Packet Tracer and configure it task by task. Try each one before opening the solution.

By topologia.appUpdated: Nov 13, 2026⏱ 30 min❓ 4 questions📶 Level intermediate

In a nutshell

You will configure 2 switches and 1 router: VLANs 10 and 20, trunks with native VLAN 999, router-on-a-stick and management VLAN 99. At the end, PC1 must ping PC2 and PC3.

In this lesson
  1. Topology
  2. Addressing table
  3. Task 1: create the VLANs on SW1 and SW2
  4. Task 2: access ports
  5. Task 3: trunks with native VLAN 999
  6. Task 4: router-on-a-stick on R1
  7. Task 5: switch management
  8. Task 6: verify
  9. What you must remember
  10. Exam-style questions

Topology

Lab topology: R1 trunked to SW1, SW1 trunked to SW2, PC1 on SW1 and PC2 and PC3 on SW2 TRUNKTRUNK (native 999) G0/0G0/1G0/2G0/2 R1 SW1 SW2 PC1 · V10 PC2 · V20 PC3 · V10 G0/0.10 192.168.10.1G0/0.20 192.168.20.1G0/0.99 192.168.99.1 Fa0/1Fa0/1Fa0/2
Devices: R1 (2911 or 4331 router), SW1 and SW2 (2960 switches) and 3 PCs. Use straight-through cables.Edit in the editor ↗

Addressing table

DeviceInterfaceVLANIP addressGateway
R1G0/0.1010192.168.10.1/24—
R1G0/0.2020192.168.20.1/24—
R1G0/0.9999192.168.99.1/24—
SW1Vlan9999192.168.99.11/24192.168.99.1
SW2Vlan9999192.168.99.12/24192.168.99.1
PC1SW1 Fa0/110192.168.10.11/24192.168.10.1
PC2SW2 Fa0/120192.168.20.12/24192.168.20.1
PC3SW2 Fa0/210192.168.10.13/24192.168.10.1

VLANs: 10 SALES, 20 ACCOUNTING, 99 MANAGEMENT, 999 NATIVE (no users).

Task 1: create the VLANs on SW1 and SW2

Show solution: VLANs (same on SW1 and SW2)
SW1(config)# vlan 10
SW1(config-vlan)# name SALES
SW1(config-vlan)# vlan 20
SW1(config-vlan)# name ACCOUNTING
SW1(config-vlan)# vlan 99
SW1(config-vlan)# name MANAGEMENT
SW1(config-vlan)# vlan 999
SW1(config-vlan)# name NATIVE

Task 2: access ports

SW1 Fa0/1 → VLAN 10. SW2 Fa0/1 → VLAN 20 and SW2 Fa0/2 → VLAN 10. Disable DTP on them.

Show solution: access ports
SW1(config)# interface fa0/1
SW1(config-if)# switchport mode access
SW1(config-if)# switchport access vlan 10
SW1(config-if)# switchport nonegotiate

SW2(config)# interface fa0/1
SW2(config-if)# switchport mode access
SW2(config-if)# switchport access vlan 20
SW2(config-if)# switchport nonegotiate
SW2(config)# interface fa0/2
SW2(config-if)# switchport mode access
SW2(config-if)# switchport access vlan 10
SW2(config-if)# switchport nonegotiate

Task 3: trunks with native VLAN 999

Configure SW1 G0/1 (towards R1), SW1 G0/2 and SW2 G0/2 as trunks. Native 999, allowed VLANs 10, 20, 99 and 999, no DTP.

Show solution: trunks
SW1(config)# interface range g0/1 - 2
SW1(config-if-range)# switchport mode trunk
SW1(config-if-range)# switchport trunk native vlan 999
SW1(config-if-range)# switchport trunk allowed vlan 10,20,99,999
SW1(config-if-range)# switchport nonegotiate

SW2(config)# interface g0/2
SW2(config-if)# switchport mode trunk
SW2(config-if)# switchport trunk native vlan 999
SW2(config-if)# switchport trunk allowed vlan 10,20,99,999
SW2(config-if)# switchport nonegotiate

Task 4: router-on-a-stick on R1

Show solution: R1
R1(config)# interface g0/0
R1(config-if)# no shutdown
R1(config)# interface g0/0.10
R1(config-subif)# encapsulation dot1Q 10
R1(config-subif)# ip address 192.168.10.1 255.255.255.0
R1(config)# interface g0/0.20
R1(config-subif)# encapsulation dot1Q 20
R1(config-subif)# ip address 192.168.20.1 255.255.255.0
R1(config)# interface g0/0.99
R1(config-subif)# encapsulation dot1Q 99
R1(config-subif)# ip address 192.168.99.1 255.255.255.0
R1(config)# interface g0/0.999
R1(config-subif)# encapsulation dot1Q 999 native  ← same native as the switches

Task 5: switch management

Show solution: management
SW1(config)# interface vlan 99
SW1(config-if)# ip address 192.168.99.11 255.255.255.0
SW1(config-if)# no shutdown
SW1(config)# ip default-gateway 192.168.99.1

SW2(config)# interface vlan 99
SW2(config-if)# ip address 192.168.99.12 255.255.255.0
SW2(config-if)# no shutdown
SW2(config)# ip default-gateway 192.168.99.1

Task 6: verify

TestExpected resultWhat it proves
PC1 → ping 192.168.10.13 (PC3)SuccessVLAN 10 crosses the SW1–SW2 trunk
PC1 → ping 192.168.20.12 (PC2)SuccessR1 routes between VLANs
PC1 → ping 192.168.99.12 (SW2)SuccessSW2 management and gateway are correct
show interfaces trunk on SW1Gi0/1 and Gi0/2, native 999Trunks are correctly formed
show vlan brief on SW2Fa0/1 in 20, Fa0/2 in 10Access ports are correct

If something fails

Follow the method from the verification lesson: VLAN exists → port → trunk → native → Layer 3. The first ping often fails while ARP resolves; repeat it.

What you must remember

  • Create the same VLANs on every switch in the path.
  • Trunks with the same native VLAN and only the needed VLANs.
  • One router subinterface per VLAN, including management.
  • Verify with ping and with show vlan brief / show interfaces trunk.

Check what you learned

4 exam-style questions. Some have one answer and others ask you to choose several. Answer them all to complete the lesson.

Question 1 of 4 · One answerIn the lab, PC1 pings PC3 (both in VLAN 10). Which devices does that traffic go through?
Question 2 of 4 · One answerIn the lab, PC1 (VLAN 10) pings PC2 (VLAN 20). Which path does the packet follow?
Question 3 of 4 · Choose twoOn SW1, switchport trunk allowed vlan 10,99,999 is entered by mistake on G0/2 (VLAN 20 is missing). Which two results are expected? (Choose two.)
Question 4 of 4 · One answerFrom PC1 you cannot ping 192.168.99.12 (SW2), but you can from R1. What is probably missing on SW2?