Packet Tracer Labs

Lab 2: Creating VLANs and Assigning Ports

Create two VLANs — SALES (10) and HR (20) — assign ports, and prove that PCs in different VLANs cannot ping each other even on the same switch. Difficulty: Beginner · Time: ~25 min.

Lab objectives

  • Create VLANs 10 and 20 with names
  • Assign access ports to each VLAN
  • Verify with show vlan brief
  • Demonstrate VLAN isolation with ping

Topology & addressing

Devices: 1× 2960 switch, 4× PCs. PC1 & PC2 → ports Fa0/1–2 (VLAN 10, IPs 192.168.10.11–12/24). PC3 & PC4 → ports Fa0/3–4 (VLAN 20, IPs 192.168.20.11–12/24).

Step-by-step configuration

vlan 10
name SALES
vlan 20
name HR
Create and name the VLANs
interface range fa0/1 - 2
switchport mode access
switchport access vlan 10
Put ports 1–2 in VLAN 10
interface range fa0/3 - 4
switchport mode access
switchport access vlan 20
Put ports 3–4 in VLAN 20

Verification

show vlan brief — VLANs 10 and 20 listed with the right ports. PC1 → PC2 ping succeeds (same VLAN); PC1 → PC3 ping fails (different VLANs — isolation working exactly as designed). Routing between them comes in the router-on-a-stick lab.

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

Why can't PCs in different VLANs communicate?

VLANs are separate broadcast domains at Layer 2 — traffic between them requires a Layer 3 device to route it.

What does switchport mode access do?

It fixes the port as an access port carrying exactly one VLAN, disabling trunk negotiation.

How do I see which ports are in which VLAN?

show vlan brief lists every VLAN with its name, status and assigned ports.

VS
Vipul Sir — Lead Instructor, Attila Technologies20+ years in Cisco networking. Teaching CCNA, CCNP, CCIE & CyberOps in Ahmedabad since 2004.

Want hands-on training?

Learn this on real Cisco lab devices with placement support at Attila Technologies, Ahmedabad.

Start your networking career with Attila Technologies

Hands-on Cisco training, real lab devices and placement support in Ahmedabad.