free lab · CertCrack Packet Tracer Labs · All labs

Lab 3: VLANs & 802.1Q Trunking

CCNA domain: Domain 2 · Network Access (VLANs and trunking)  ·  Difficulty: Beginner–Intermediate  ·  Time: ~30 minutes  ·  Devices: 2 switches (2960), 6 PCs

One physical switch, three separate networks. CertCrack.com's office has Sales, Engineering and Operations teams that must not share a broadcast domain, so you will carve both switches into VLANs 10, 20 and 30, place two PCs in each VLAN across the two switches, and connect the switches with an 802.1Q trunk that tags traffic so each frame keeps its VLAN identity as it crosses. By the end, a Sales PC will reach the Sales PC on the far switch — but nothing else.

Your progress on this lab

0 of 5 tasks done — tick tasks off as you finish them; progress is saved in this browser.

What you need

Topology

SW12960SW22960PC0V10 · 192.168.10.11PC1V20 · 192.168.20.11PC2V30 · 192.168.30.11PC3V10 · 192.168.10.12PC4V20 · 192.168.20.12PC5V30 · 192.168.30.12Fa0/24 — 802.1Q trunk — Fa0/24Fa0/1Fa0/2Fa0/3Fa0/1Fa0/2Fa0/3

Each VLAN gets its own /24 so the design carries straight into Lab 4: VLAN 10 (Sales) uses 192.168.10.0/24, VLAN 20 (Engineering) 192.168.20.0/24, VLAN 30 (Operations) 192.168.30.0/24. No default gateway is configured in this lab on purpose — Layer 2 switching is the whole lesson, and you will see in Task 5 exactly where its power ends.

DeviceInterfaceIP addressNotes
SW1FastEthernet 0/1Access · VLAN 10To PC0
SW1FastEthernet 0/2Access · VLAN 20To PC1
SW1FastEthernet 0/3Access · VLAN 30To PC2
SW1FastEthernet 0/24Trunk · 802.1QTo SW2 Fa0/24 — carries VLANs 10, 20, 30
SW2FastEthernet 0/1Access · VLAN 10To PC3
SW2FastEthernet 0/2Access · VLAN 20To PC4
SW2FastEthernet 0/3Access · VLAN 30To PC5
SW2FastEthernet 0/24Trunk · 802.1QTo SW1 Fa0/24
PC0 / PC3FastEthernet 0192.168.10.11 / 192.168.10.12VLAN 10 Sales, mask 255.255.255.0, no gateway
PC1 / PC4FastEthernet 0192.168.20.11 / 192.168.20.12VLAN 20 Engineering, mask 255.255.255.0, no gateway
PC2 / PC5FastEthernet 0192.168.30.11 / 192.168.30.12VLAN 30 Operations, mask 255.255.255.0, no gateway

Tasks

Build the topology first, then work through the tasks in order. Try each task from memory before you open the commands — that is how the skill sticks. Click Show commands only when you are stuck or to check your work.

Task 1 — Create the three VLANs on SW1

VLANs live in the switch's VLAN database, and a port assigned to a VLAN that does not exist yet stays inactive — so create the VLANs first, on both switches, before touching ports. Naming VLANs is optional but makes show vlan brief output far easier to read. On SW1:

enable
configure terminal
vlan 10
name Sales
vlan 20
name Engineering
vlan 30
name Operations
exit

Task 2 — Assign SW1's access ports

An access port belongs to exactly one VLAN and sends frames untagged — the PC never knows VLANs exist. Put SW1's Fa0/1 in VLAN 10, Fa0/2 in VLAN 20 and Fa0/3 in VLAN 30. Repeat the two switchport lines per port; setting the mode explicitly to access also stops the port from ever negotiating a trunk.

interface fastEthernet 0/1
switchport mode access
switchport access vlan 10
interface fastEthernet 0/2
switchport mode access
switchport access vlan 20
interface fastEthernet 0/3
switchport mode access
switchport access vlan 30
exit

Task 3 — Repeat the VLANs and access ports on SW2

Trunks do not share VLAN databases in this basic setup (that would be VTP, which is outside this lab), so SW2 needs the identical VLANs and port assignments. Run the same commands on SW2: create VLANs 10, 20 and 30 with the same names, then assign Fa0/1, Fa0/2 and Fa0/3 as access ports in VLANs 10, 20 and 30.

enable
configure terminal
vlan 10
name Sales
vlan 20
name Engineering
vlan 30
name Operations
interface fastEthernet 0/1
switchport mode access
switchport access vlan 10
interface fastEthernet 0/2
switchport mode access
switchport access vlan 20
interface fastEthernet 0/3
switchport mode access
switchport access vlan 30
exit

Task 4 — Build the 802.1Q trunk between the switches

A trunk carries many VLANs over one link by inserting an 802.1Q tag into each frame. The Catalyst 2960 only speaks 802.1Q, so there is no encapsulation command to set — just force trunk mode on both ends of the SW1–SW2 link. A trunk configured on only one side will not form. Configure Fa0/24 on SW1, then the matching command on SW2:

On SW1:
interface fastEthernet 0/24
switchport mode trunk
exit

On SW2:
interface fastEthernet 0/24
switchport mode trunk
exit

Task 5 — Address the PCs and test the VLAN boundaries

Give each PC its static address from the plan (mask 255.255.255.0, leave the gateway blank). Then test the design's promise: a PC must reach its VLAN partner on the other switch through the trunk, and must not reach PCs in other VLANs. From PC0's Command Prompt:

PC IP settings (Desktop > IP Configuration, Static, gateway blank):
PC0 192.168.10.11    PC3 192.168.10.12
PC1 192.168.20.11    PC4 192.168.20.12
PC2 192.168.30.11    PC5 192.168.30.12
All masks: 255.255.255.0

PC0 > Command Prompt:
ping 192.168.10.12
ping 192.168.20.11

Verification

Run these checks from the device CLI (or a PC command prompt where noted). Your output should match the description — wording may vary slightly by Packet Tracer version.

Exam connection

Domain 2 (Network Access) is built on exactly these commands: creating VLANs, access vs. trunk ports, 802.1Q tagging, and reading show vlan brief and show interfaces trunk output to find the one wrong port. The classic exam trap is a VLAN missing on one switch or a trunk allowed on only one side — this lab makes you build both sides correctly, then prove it. Reinforce it with the free 30-question CCNA practice sample and the CCNA 200-301 guidebook.

Turn lab skills into exam marks

VLAN and trunk output questions are CCNA staples. Take the free sample and check you can read the show output as fast as you can now produce it.

Free CCNA SampleCCNA Guidebook

FAQ

Why doesn't the trunk port appear in show vlan brief?

show vlan brief lists only access ports and the VLANs they belong to. A trunk port is not 'in' a single VLAN — it carries many — so Cisco reports it in show interfaces trunk instead. Checking both commands is how you verify a switch completely: brief for the access side, trunk for the uplinks.

Do I need switchport trunk encapsulation on a 2960?

No. The Catalyst 2960 supports only 802.1Q, so the encapsulation is fixed and the command does not exist on that platform. On switches that support both ISL and 802.1Q (older Catalyst models) you must set switchport trunk encapsulation dot1q before the port will trunk — a favorite CCNA detail.

Why can't PCs in different VLANs ping each other here?

A VLAN is a separate broadcast domain and, with its own subnet, a separate network. Switches forward frames only inside one VLAN; moving packets between VLANs is routing, a Layer 3 job. Nothing in this topology routes — Lab 4 adds a router-on-a-stick to fix exactly that.

← Previous labLab 2: IPv4 Addressing & Subnetting Next lab →Lab 4: Inter-VLAN Routing (Router-on-a-Stick)

More free tools

Packet Tracer LabsAll 10 free CCNA hands-on labs Subnet CalculatorNetwork, broadcast & host ranges from any IP/CIDR Subnetting PracticeTimed subnet drills with worked solutions OSI Model QuizLearn the 7 layers and test yourself All Free ToolsThe CertCrack tools hub