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
- Cisco Packet Tracer, installed and signed in (free — see how to get Packet Tracer free on the labs hub).
- A brand-new, blank Packet Tracer workspace — do not reuse a previous lab file, the starting state matters.
- Devices: two 2960 switches and six PCs. Cable each PC to its switch access port, and SW1 Fa0/24 to SW2 Fa0/24 for the trunk (copper straight-through).
Topology
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.
| Device | Interface | IP address | Notes |
|---|---|---|---|
| SW1 | FastEthernet 0/1 | Access · VLAN 10 | To PC0 |
| SW1 | FastEthernet 0/2 | Access · VLAN 20 | To PC1 |
| SW1 | FastEthernet 0/3 | Access · VLAN 30 | To PC2 |
| SW1 | FastEthernet 0/24 | Trunk · 802.1Q | To SW2 Fa0/24 — carries VLANs 10, 20, 30 |
| SW2 | FastEthernet 0/1 | Access · VLAN 10 | To PC3 |
| SW2 | FastEthernet 0/2 | Access · VLAN 20 | To PC4 |
| SW2 | FastEthernet 0/3 | Access · VLAN 30 | To PC5 |
| SW2 | FastEthernet 0/24 | Trunk · 802.1Q | To SW1 Fa0/24 |
| PC0 / PC3 | FastEthernet 0 | 192.168.10.11 / 192.168.10.12 | VLAN 10 Sales, mask 255.255.255.0, no gateway |
| PC1 / PC4 | FastEthernet 0 | 192.168.20.11 / 192.168.20.12 | VLAN 20 Engineering, mask 255.255.255.0, no gateway |
| PC2 / PC5 | FastEthernet 0 | 192.168.30.11 / 192.168.30.12 | VLAN 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.
- show vlan brief on both switches — VLANs 10 Sales, 20 Engineering and 30 Operations each list exactly their two access ports (one local PC port plus, on this output, only access ports are shown — the trunk never appears in this list).
- show interfaces trunk — Fa0/24 shows mode on, status trunking, encapsulation 802.1Q, and VLANs 10, 20 and 30 in the "Vlans in spanning tree forwarding state" list.
- PC0 → PC3 ping (192.168.10.12) succeeds — same VLAN, across the trunk. PC0 → PC1 ping (192.168.20.11) times out — different VLAN, no router exists yet. Both results are correct behavior, not faults.
- show interfaces fastEthernet 0/24 switchport — confirms "Administrative Mode: trunk" and "Operational Mode: trunk" on both switches.
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 GuidebookFAQ
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.