The problem VLANs address
Imagine an office where staff computers, printers, servers and guest devices all share one network. Without further separation, those devices can communicate directly at the local-network level, so a guest device and an internal server may sit in the same Layer 2 broadcast domain.
A VLAN (virtual LAN) groups devices logically, even when they connect through the same switching equipment. It is a logical segmentation of a switched network, and can group devices by function, team or application rather than by physical location.[1][2]
What a VLAN separates
Devices in the same VLAN can communicate directly at Layer 2. Devices in different VLANs cannot; traffic between them must be routed by a device that supports routing between VLANs.[1][2]
Each VLAN is also a separate broadcast domain, so broadcast traffic stays inside its VLAN instead of reaching every device on the switch.[1]
A simple office might use the three groupings below. This is an illustration, not a universal design; the right grouping depends on the organisation, the equipment and the requirements.
- Staff: employee computers and internal servers, for internal work.
- Guests: visitor phones and laptops, for internet access.
- Infrastructure: switches, access points and management interfaces, for managing network equipment.
A staff computer and a guest device can be plugged into the same physical switch yet remain in different VLANs. Physical connection and logical membership are different things.
Access ports, trunks and tags
An access port carries traffic for one VLAN and is typically where an end device, such as a computer or printer, connects.[3]
A trunk port carries traffic for several VLANs over one link, for example between switches.[3][4]
When several VLANs share a trunk, the receiving device must know which VLAN each frame belongs to. IEEE 802.1Q provides a common method: a tag in the Ethernet frame carries a VLAN identifier.[5]
In simplified terms:
- A device sends traffic into an access port.
- The switch associates the traffic with that port’s VLAN.
- If the destination is behind another switch, the traffic crosses a trunk.
- The trunk carries the VLAN identification the receiving switch needs.
- The receiving switch forwards the traffic according to its VLAN configuration.
Tagging lets multiple VLANs share one link. It does not decide who is allowed to communicate with whom.
Optional detail: terminology varies by vendor
Port modes, defaults and command syntax differ between vendors and software versions. The concepts above are general; before configuring real equipment, read the documentation for that exact model and release.
Moving between VLANs
Communication between VLANs requires routing. A router, a Layer 3 switch or another routing-capable device forwards traffic from one VLAN to another; without one, VLANs stay separate at Layer 2.[1][2]
This is where policy matters. The VLAN creates a boundary, and the routing device decides what may cross it. Depending on configuration, it might:
- allow all traffic between VLANs;
- allow only selected traffic;
- block most traffic while permitting one specific service;
- hand traffic to a firewall that inspects or controls it in more detail.
What VLANs do not do
They do not provide security by themselves
Placing devices in separate VLANs does not define a security policy. If routing between VLANs is broadly permitted, devices in different VLANs can still communicate. VLANs can support a security design by creating boundaries that policy can control, but they do not replace access control, firewall rules, authentication, monitoring or secure device configuration.[6][1]
They do not prevent every internal problem
A compromised device can still affect other devices in its own VLAN. Separation limits some paths; it does not make a VLAN inherently safe.
They do not replace a network design
A VLAN number alone does not show that a design is sensible. The useful questions are:
- Which devices need to communicate?
- Which should not communicate directly?
- Where should traffic be permitted, restricted or inspected?
- How will the design be operated and verified?
Common misunderstandings
“We have VLANs, so guests cannot reach the internal network.”
Not necessarily. Guests may be in a different VLAN, but routing between VLANs and the access rules decide whether they can reach internal resources.[1][2]
“Everything is on one VLAN, so there is no separation.”
At Layer 2, devices in the same VLAN share a broadcast domain and can communicate directly, subject to the network’s configuration. That does not make every higher-layer service accessible, but it does mean VLAN separation has not been used to create a boundary.[1]
“A trunk is insecure because it carries several VLANs.”
A trunk does carry several VLANs. Whether that is appropriate depends on the design, the devices involved and the controls applied to the traffic.[3][4]
“Two computers on the same switch must be in the same VLAN.”
No. VLAN membership comes from the switch configuration, not from the physical connection to the same device.[1]
A useful picture: VLANs are logical rooms in a building. Doors and access rules decide who may move between rooms, and a door that is always open provides little separation. The analogy has limits, but the central point holds: VLANs create boundaries; policy determines what crosses them.
What to remember
The essentials
- A VLAN is a logical segmentation of a switched network.[1]
- Devices in different VLANs do not communicate directly at Layer 2; communication between them requires routing.[1][2]
- Access ports typically carry one VLAN; trunks can carry several.[3][4]
- IEEE 802.1Q tagging identifies VLAN membership on trunk links.[5]
- VLAN separation can support a security design, but it is not security by itself.[6]