A VLAN (virtual local area network) is a separate logical network created inside a switch, so one set of switches, cables and access points can carry several networks that cannot reach each other directly. For a business, VLANs are how staff computers, phones, guest Wi-Fi, cameras and payment terminals share the same hardware while staying apart, with a router or firewall deciding what may cross between them.
VLANs work at Layer 2, the Ethernet layer. Each VLAN is its own broadcast domain: a broadcast sent by a device on VLAN 20 reaches every device on VLAN 20 and nothing else, even when devices on VLAN 30 are plugged into the next port on the same switch. That is the whole trick, and nearly everything else on this page follows from it.
What a VLAN changes on a network
Without VLANs, every device plugged into the office switches, and every device on the Wi-Fi, sits on one flat network. Any device can find and talk to any other. A guest's laptop can see the file server, a camera with old firmware can reach the accounting PC, and every broadcast from every device lands everywhere.
With VLANs, the switch assigns each port, and each Wi-Fi network name, to a VLAN number. Devices on different VLANs are as separate as if they were on different switches. To talk to each other, their traffic has to leave the VLAN and pass through a device that routes, which is where you get to apply rules. Our guide to VLANs and network segmentation covers which segments a small business usually needs and how to set them up; this page explains the mechanics underneath.
How VLAN tagging works (IEEE 802.1Q)
The standard behind VLANs is IEEE 802.1Q. When a frame has to travel between switches and still remember which VLAN it belongs to, the switch inserts a 4-byte tag into the Ethernet header. The tag holds three things that matter:
- The VLAN ID. A 12-bit number. Values 0 and 4095 are reserved, which leaves 1 to 4094 for real VLANs.
- A priority value. Three bits, often called 802.1p or CoS, giving eight priority levels that switches can use to send voice ahead of bulk traffic. Quality of service settings decide how those marks are used.
- A drop eligibility bit. One bit that marks frames as safer to discard first when a link is congested.
Most end devices never see a tag. A laptop sends an ordinary untagged frame, the switch knows which VLAN that port belongs to, and it adds the tag only if the frame needs to cross to another switch, a firewall or an access point. The receiving device reads the tag, removes it and delivers an ordinary frame at the other end.
Carriers use the same idea. Some business circuits are handed off on a specific VLAN tag that your firewall must match, and Ethernet services that carry several virtual circuits over one port typically tell them apart by VLAN ID. Carriers can also stack a second tag on top of yours (IEEE 802.1ad, often called Q-in-Q) to keep customers separate inside their own network.
Tagged vs untagged ports: access, trunk and native VLAN
Every switch port has a VLAN configuration, and the vocabulary varies by vendor. Some call ports "access" and "trunk"; others describe each port as an "untagged member" or "tagged member" of each VLAN. The behavior is the same.
| Port setup | VLANs it carries | Tags on the wire | Typical device on the other end |
|---|---|---|---|
| Access port (untagged member of one VLAN) | One | None | Desktop, printer, camera |
| Trunk port (tagged member of several VLANs) | Several | Yes, one tag per frame | Another switch, the firewall, a Wi-Fi access point |
| Native VLAN on a trunk | One VLAN on a trunk is left untagged | None for that VLAN | Often used for device management; must match on both ends |
| Voice port (data untagged, voice tagged) | Two | Tagged for the phone only | A desk phone with a computer plugged into its back |
Two mismatches cause most VLAN faults. If one end of a trunk tags a VLAN and the other end does not expect it, that VLAN's traffic disappears. If the two ends disagree on the native VLAN, traffic from one VLAN leaks into another. When a new access point or switch "has no network" while the old one worked, compare the port settings on both ends first.
Following one frame across the office
Tracing a single frame from a guest's phone shows where tags appear and disappear. Illustration only; the VLAN numbers are examples.
| Step | What happens | Tag on the frame |
|---|---|---|
| Phone joins the "Visitors" Wi-Fi network | The access point maps that network name to VLAN 30 | None over the air |
| Access point sends the frame to the switch | The uplink is a trunk carrying staff, voice and guest VLANs | VLAN 30 |
| Switch forwards it toward the firewall | Only trunk ports that carry VLAN 30 can receive it | VLAN 30 |
| Firewall receives it on its VLAN 30 interface | Guest rules apply: internet allowed, office addresses blocked | Removed |
| Firewall sends it to the internet | Ordinary internet traffic | None |
At no point does the frame touch a port that belongs only to the staff VLAN, so the guest phone never learns the staff network exists. Our guest Wi-Fi security guide covers the firewall rules and isolation settings that complete the picture.
Inter-VLAN routing: how VLANs talk to each other
A VLAN on its own is a dead end. Devices on VLAN 10 can reach other devices on VLAN 10 and nothing more. For staff to print to a printer on another VLAN, or for phones to reach the internet, something has to route between VLANs. There are two common designs.
- Routing on the firewall. One trunk runs from the core switch to the firewall, and the firewall has a virtual interface for each VLAN. This is sometimes called "router on a stick." Every packet that crosses VLANs passes through the firewall's rules and logs, which is why most small and mid-sized offices use it.
- Routing on a Layer 3 switch. The switch routes between VLANs in hardware at full port speed. It suits large internal transfers, though switch access lists are usually simpler than firewall rules. Our page on routers vs switches explains what a Layer 3 switch is.
Routing needs addresses, so each VLAN normally gets its own IP range. That range is a subnet, and the routing device holds the gateway address for each one. Devices on each VLAN usually get their addresses from a separate DHCP scope, which our page on DHCP explains.
VLAN vs subnet
The two are paired so often that people use the words interchangeably. They sit at different layers and are enforced by different equipment.
| VLAN | Subnet | |
|---|---|---|
| Network layer | Layer 2 (Ethernet frames) | Layer 3 (IP addresses) |
| Identified by | A VLAN ID from 1 to 4094 | A network address and mask, such as 10.0.30.0/24 |
| Enforced by | Switches and access points | Routers and firewalls, plus each device's own settings |
| What it separates | Which devices can exchange frames at all | Which addresses count as local and which need a gateway |
| Can a device escape it on its own? | No, the switch port decides | Yes, a user can type a different address and mask |
| Usual pairing | One VLAN for each subnet | One subnet for each VLAN, often with the VLAN number repeated in the address so it is easy to read |
The last row but one is why VLANs matter for security. Two subnets on the same flat switch are separated only by agreement, and anyone who changes their address can step across. Two VLANs are separated by the switch itself.
What VLANs do not protect against
- Allow-all rules. If the firewall routes between VLANs with no restrictions, the segments are separate in name only. The protection comes from the rules.
- Loose switch defaults. Ports that negotiate trunking automatically, or user devices left on the native VLAN, open the door to VLAN hopping, where an attacker gets frames onto a VLAN they should not reach. Set trunks by hand, turn off automatic trunk negotiation and keep the native VLAN free of user devices.
- Unmanaged switches in the path. A cheap desktop switch may pass tags along, drop them or mix VLANs together. Our guide to managed vs unmanaged switches explains where each kind belongs.
- Threats that arrive from outside. A VLAN limits how far a problem spreads inside the building. It does nothing about phishing, weak passwords or unpatched software.
What to check before you plan VLANs
- Every switch between the closet and the desks is a managed switch that supports 802.1Q.
- The access points can map each Wi-Fi network name to its own VLAN.
- The firewall can create an interface per VLAN and filter traffic between them.
- The desk phones can learn a voice VLAN automatically, for example through LLDP or a DHCP option, or can be set by hand.
- If the carrier's handoff uses a VLAN tag, the order or turn-up sheet says which one.
- Someone will keep a diagram of which ports, network names and VLANs go together.
How FiberX helps
FiberX gets quotes from several carriers for your address and checks the handoff details your firewall has to match, including whether the circuit is delivered on a tagged VLAN. We can also quote managed network services to design and run the switches, Wi-Fi and VLANs behind the circuit, and managed cybersecurity for the firewall rules between segments. The carrier pays us, so there is no markup. Request a quote, or call or text 478-758-8091.