VLAN (Virtual Local Area Network)
A Virtual Local Area Network (VLAN) separates a bridged Ethernet network into logical Layer 2 broadcast domains. Devices in different VLANs need a Layer 3 forwarding path to communicate across that boundary.
A Layer 2 boundary
A VLAN groups Ethernet ports and traffic into a logical broadcast domain. Two devices can be connected to the same physical switch and still belong to different VLANs. ARP broadcasts in one VLAN are not simply flooded into every other VLAN on that switch.
IEEE 802.1Q provides VLAN tagging for bridged Ethernet networks. A tag identifies the VLAN so an appropriately configured link can carry traffic from several VLANs. The 12-bit VLAN identifier field has reserved values; ordinary configurable VLAN IDs are commonly in the range 1–4094.
Access-port and trunk example
An office uses VLAN 10 for workstations and VLAN 20 for a lab.
- A workstation's access port places its untagged traffic in VLAN 10.
- A lab machine's access port places its traffic in VLAN 20.
- A trunk between switches carries the VLANs allowed by its configuration, commonly using tags to distinguish them.
An untagged or native VLAN configuration must agree where required by the devices and design. Merely using the same VLAN number on two disconnected networks does not connect them.
VLAN versus subnet
A VLAN is a Layer 2 grouping; an IP subnet describes a Layer 3 address prefix. A design often assigns one subnet to each VLAN, but these are separate configuration choices, not two names for the same thing.
If a workstation in VLAN 10 needs an address in VLAN 20, a router, firewall or Layer 3 switch normally provides inter-VLAN routing. That device also needs suitable routes and policy. Sharing a physical switch is not enough to provide that path.
Inspect a Linux bridge
These read-only commands help inspect VLAN membership and address configuration when Linux bridge VLAN filtering is in use:
bridge vlan show
ip -d link show
ip address show
A physical switch has its own equivalent operational commands. Check tagging, allowed VLANs and endpoint addressing together rather than inferring membership from an IP address alone.
Common confusions
A VLAN does not encrypt traffic. It can provide separation, but security also depends on correct port configuration, routing and access controls. A VLAN tag also does not supply a device with an IP address; DHCP or other address configuration remains a separate concern.