VLAN Explained: What Is a VLAN and How to Configure It on Cisco (Step-by-Step)

Learn what a VLAN is, why networks use them, access vs trunk ports, 802.1Q tagging, and Cisco VLAN configuration with verification commands

A VLAN (Virtual Local Area Network) lets you split one physical switch into several separate logical networks. VLANs are one of the most important CCNA topics and a key building block for network security. This guide explains them and shows a basic Cisco configuration.

What Is a VLAN?

By default, every device on a switch is in the same broadcast domain. A VLAN divides the switch so that, for example, Staff, Guests, and Servers cannot see each other's traffic unless a router or Layer 3 device allows it.

Why Use VLANs?

  • Security: isolate sensitive systems from guests and IoT devices.
  • Performance: smaller broadcast domains mean less unnecessary traffic.
  • Flexibility: group users by function, not by physical location.
  • Easier management: apply policies per VLAN.

Access Ports vs Trunk Ports

Access portTrunk port
CarriesOne VLANMany VLANs
ConnectsEnd devices (PCs, printers)Switch to switch, or switch to router/firewall
TaggingUntaggedFrames tagged with 802.1Q (except native VLAN)

802.1Q is the standard that adds a VLAN tag to frames on trunk links so the other side knows which VLAN each frame belongs to.

Example Design

VLANNameSubnet
10STAFF192.168.10.0/24
20GUEST192.168.20.0/24
30SERVERS192.168.30.0/24

Cisco Configuration

1. Create the VLANs

Switch(config)# vlan 10
Switch(config-vlan)# name STAFF
Switch(config-vlan)# vlan 20
Switch(config-vlan)# name GUEST
Switch(config-vlan)# vlan 30
Switch(config-vlan)# name SERVERS

2. Assign access ports

Switch(config)# interface gigabitEthernet 0/1
Switch(config-if)# switchport mode access
Switch(config-if)# switchport access vlan 10

3. Configure a trunk port

Switch(config)# interface gigabitEthernet 0/24
Switch(config-if)# switchport mode trunk
Switch(config-if)# switchport trunk allowed vlan 10,20,30

On some older switch models you must first enter switchport trunk encapsulation dot1q.

Verify

show vlan brief
show interfaces trunk
show interfaces gigabitEthernet 0/1 switchport

Letting VLANs Talk: Inter-VLAN Routing

Devices in different VLANs need a Layer 3 device to communicate. Two common options:

  • Router-on-a-stick: one trunk link to a router with a sub-interface per VLAN.
  • Layer 3 switch with SVIs: a virtual interface per VLAN on the switch itself.
Switch(config)# ip routing
Switch(config)# interface vlan 10
Switch(config-if)# ip address 192.168.10.1 255.255.255.0
Switch(config-if)# no shutdown

More on this in Routing vs Switching. You can also route between VLANs on a firewall and control that traffic with policies. See FortiGate Firewall Policy Best Practices.

VLAN Security Tips

  • Do not use VLAN 1 for user traffic.
  • Change the native VLAN to an unused VLAN on trunks.
  • Shut down and move unused ports to an unused VLAN.
  • Allow only the needed VLANs on each trunk.

Frequently Asked Questions

Does a VLAN need its own subnet? By convention, yes: one VLAN maps to one IP subnet.

Is a VLAN a firewall? No. A VLAN separates traffic, but you still need routing rules or firewall policies to control what may cross between VLANs.

Conclusion

VLANs divide one switch into separate networks for security, performance, and flexibility. Learn access ports, trunk ports, and inter-VLAN routing, and you have mastered the core of campus networking. Practice them in your home lab.

NextGen Digital... Welcome to WhatsApp chat
Howdy! How can we help you today?
Type here...