VLAN and Trunk Lab
Configure access/trunk ports and verify VLAN segmentation.
Objectives
- Create VLANs 10 and 20 on both switches
- Assign access ports to VLANs
- Configure an 802.1Q trunk between switches
- Verify isolation and inter-switch VLAN transport
Topology
PC1 (VLAN 10) ── SW1 ══ trunk ══ SW2 ── PC2 (VLAN 10) and PC3 (VLAN 20). Trunk between SW1 and SW2.
Prerequisites
- VLAN and trunk lessons (Week 3)
- Packet Tracer 8.x or real switches
Instructions
Step 1
Create VLANs
On both switches, create VLAN 10 (Sales) and VLAN 20 (Engineering).
Switch(config)# vlan 10 Switch(config-vlan)# name Sales Switch(config)# vlan 20 Switch(config-vlan)# name Engineering Switch# show vlan brief
Step 2
Access ports
Assign PC-facing ports as access ports in the correct VLAN. PCs in different VLANs should not ping each other on the same switch.
Switch(config)# interface fa0/1 Switch(config-if)# switchport mode access Switch(config-if)# switchport access vlan 10
Step 3
Trunk between switches
Configure the inter-switch link as an 802.1Q trunk. Allow VLANs 10 and 20. Match native VLAN on both ends.
Switch(config)# interface fa0/24 Switch(config-if)# switchport mode trunk Switch(config-if)# switchport trunk allowed vlan 10,20 Switch# show interfaces trunk
Step 4
Test segmentation
Same VLAN across switches should ping; different VLANs should fail at Layer 2 unless a router is added.
PC> ping <same-vlan-remote-host> PC> ping <other-vlan-host>
Verification checklist
- show vlan brief shows VLANs 10 and 20 on both switches
- show interfaces trunk lists active trunk with allowed VLANs
- Same-VLAN PCs ping across switches; different VLANs do not
Troubleshooting
Trunk not forming
Set switchport mode trunk on both ends; avoid DTP mismatch (use nonegotiate if needed).
One-way VLAN connectivity
Check allowed VLAN list and native VLAN match on both trunk ends.