How to Set Up Basic VLANs on a Single Switch (IT vs HR Example)

If you’re just starting with VLANs or documenting your lab setup, this guide walks you through a simple VLAN configuration using Cisco Packet Tracer or a real switch. We’ll isolate two departments — IT and HR — on the same switch using VLANs.
🧱 Network Scenario
- Switch: Cisco 2960 (or any managed switch)
- Departments: IT and HR
- VLANs:
- VLAN 10 – IT Department
- VLAN 20 – HR Department
- Devices:
- PC1 (IT) – 192.168.10.1/24
- PC2 (IT) – 192.168.10.2/24
- PC3 (HR) – 192.168.20.1/24
- PC4 (HR) – 192.168.20.2/24
VLAN Configuration(Cisco CLI)
enable
configure terminal
vlan 10
name IT
exit
vlan 20
name HR
exit
interface range fa0/1 – 2
switchport mode access
switchport access vlan 10
exit
interface range fa0/3 – 4
switchport mode access
switchport access vlan 20
exit
end
write memory
🖥️ IP Configuration on PCs
| PC | VLAN | IP Address | Subnet Mask |
|---|---|---|---|
| PC1 | 10 | 192.168.10.1 | 255.255.255.0 |
| PC2 | 10 | 192.168.10.2 | 255.255.255.0 |
| PC3 | 20 | 192.168.20.1 | 255.255.255.0 |
| PC4 | 20 | 192.168.20.2 | 255.255.255.0 |
✅ Ping Behavior
- ✅ PC1 ↔ PC2: Successful ping (same VLAN 10)
- ✅ PC3 ↔ PC4: Successful ping (same VLAN 20)
- ❌ PC1 ↔ PC3: Ping fails (different VLANs, no routing)
- ❌ PC2 ↔ PC4: Ping fails (same reason)