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.
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
Topology
Addressing table
| Device | Interface | VLAN | IP address | Gateway |
|---|---|---|---|---|
| R1 | G0/0.10 | 10 | 192.168.10.1/24 | — |
| R1 | G0/0.20 | 20 | 192.168.20.1/24 | — |
| R1 | G0/0.99 | 99 | 192.168.99.1/24 | — |
| SW1 | Vlan99 | 99 | 192.168.99.11/24 | 192.168.99.1 |
| SW2 | Vlan99 | 99 | 192.168.99.12/24 | 192.168.99.1 |
| PC1 | SW1 Fa0/1 | 10 | 192.168.10.11/24 | 192.168.10.1 |
| PC2 | SW2 Fa0/1 | 20 | 192.168.20.12/24 | 192.168.20.1 |
| PC3 | SW2 Fa0/2 | 10 | 192.168.10.13/24 | 192.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 NATIVETask 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 nonegotiateTask 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 nonegotiateTask 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 switchesTask 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.1Task 6: verify
| Test | Expected result | What it proves |
|---|---|---|
| PC1 → ping 192.168.10.13 (PC3) | Success | VLAN 10 crosses the SW1–SW2 trunk |
| PC1 → ping 192.168.20.12 (PC2) | Success | R1 routes between VLANs |
| PC1 → ping 192.168.99.12 (SW2) | Success | SW2 management and gateway are correct |
show interfaces trunk on SW1 | Gi0/1 and Gi0/2, native 999 | Trunks are correctly formed |
show vlan brief on SW2 | Fa0/1 in 20, Fa0/2 in 10 | Access 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.