Lab 3: Configuring an 802.1Q Trunk
Extend VLANs across two switches with an 802.1Q trunk — one physical link carrying traffic for VLAN 10 and VLAN 20 simultaneously, with same-VLAN PCs pinging across switches. Difficulty: Beginner+ · Time: ~25 min.
Lab objectives
- Create matching VLANs on both switches
- Configure the inter-switch link as a trunk
- Restrict allowed VLANs on the trunk
- Verify with show interfaces trunk
Topology & addressing
Devices: 2× 2960 switches linked Gi0/1↔Gi0/1, 4× PCs. SW1: PC1 (VLAN 10, 192.168.10.11), PC2 (VLAN 20, 192.168.20.11). SW2: PC3 (VLAN 10, 192.168.10.12), PC4 (VLAN 20, 192.168.20.12).
Step-by-step configuration
On BOTH switches:vlan 10 · vlan 20 | VLANs must exist on both sides |
interface gi0/1switchport mode trunkswitchport trunk allowed vlan 10,20 | Force trunking, allow only needed VLANs |
| Assign access ports as in Lab 2 on each switch | PCs into their VLANs |
Verification
show interfaces trunk — Gi0/1 in trunking mode with VLANs 10,20 allowed. PC1 → PC3 ping succeeds (VLAN 10 across the trunk); PC1 → PC4 fails (still inter-VLAN). One cable, many VLANs — that's trunking.
Done? Try the next lab on the labs hub, or test your knowledge on the free CCNA practice test. Get Packet Tracer free via the career hub.
Frequently asked questions
What does a trunk port do?
It carries traffic for multiple VLANs over one link, tagging each frame with its VLAN ID using 802.1Q.
Why restrict allowed VLANs on a trunk?
Security and hygiene — only the VLANs that need to cross should be permitted, reducing attack surface and unnecessary broadcast traffic.
Do VLANs need to be created on both switches?
Yes — a VLAN must exist locally on each switch for its ports and trunk tagging to work correctly.
Related articles
Want hands-on training?
Learn this on real Cisco lab devices with placement support at Attila Technologies, Ahmedabad.