What is VLAN?
VLAN (Virtual Local Area Network) is a networking technology that allows devices using the same physical network infrastructure to be logically separated into different local networks. Simply put, even if all computers in a company are connected to the same switch, VLAN technology makes it possible to place them in separate virtual networks.
For example, imagine that a company has three departments:
- Finance;
- Human Resources;
- IT.
All employees’ computers may be connected to the same physical switch. However, using VLANs, their networks can be separated as follows:
- VLAN 10 — Finance;
- VLAN 20 — Human Resources;
- VLAN 30 — IT.
Therefore, although the devices use the same physical infrastructure, they are logically placed in different networks. VLAN technology is widely used to simplify network management, limit broadcast traffic, separate user groups, and apply security policies more effectively.
What Is VLAN Used For?
The main purpose of a VLAN is to divide a large physical network into smaller logical networks. For example, imagine a company with 200 employees. If all users are located on the same local network, managing the network may become more difficult, and broadcast traffic may spread across a larger area. By using VLANs, employees can be separated into different networks according to their departments or functions.
With VLANs, it is possible to:
- divide departments into separate networks;
- reduce broadcast domains;
- simplify network management;
- apply security rules to specific groups;
- use the same physical infrastructure more efficiently;
- logically group users regardless of their physical location.
For example, a separate Guest VLAN can be created for visitors in the office, a Voice VLAN for IP phones, and a Data VLAN for employees’ computers.
How Does VLAN Work?
In a traditional switch, all ports may be part of the same Layer 2 broadcast domain. When VLANs are created, switch ports are assigned to specific VLANs.
For example:
Port 1 → VLAN 10
Port 2 → VLAN 10
Port 3 → VLAN 20
Port 4 → VLAN 20
Devices connected to Port 1 and Port 2 belong to the same VLAN, so they can communicate with each other at Layer 2. Port 3 and Port 4 belong to another VLAN. For a device in VLAN 10 to communicate with a device in VLAN 20, Layer 3 routing is usually required. This approach makes it possible to create several separate logical networks within a single physical switch.
What Is a VLAN ID?
Each VLAN has a specific identification number called a VLAN ID.
For example:
VLAN 10 → Finance
VLAN 20 → HR
VLAN 30 → IT
VLAN 40 → Guest
In the IEEE 802.1Q VLAN tagging mechanism, a 12-bit field is used for the VLAN ID. In practice, VLAN identifiers range from 1 to 4094, while 0 and 4095 are reserved for special purposes. The VLAN ID helps network devices determine which VLAN specific traffic belongs to. In large networks, assigning clear names to VLANs in addition to numerical IDs also makes network management easier.
For example:
VLAN 10 — FINANCE
VLAN 20 — HR
VLAN 30 — IT
What Is an Access Port?
An Access Port is a switch port typically used to connect an end-user device to a specific VLAN. For example, if an accountant’s computer is connected to Port 5 of a switch, that port can be assigned to VLAN 10.
On a Cisco switch, the configuration may look like this:
interface GigabitEthernet0/5
switchport mode access
switchport access vlan 10
In this case, the port operates as an access port for VLAN 10. Computers, printers, and other end-user devices are commonly connected to access ports.
What Is a Trunk Port?
A Trunk Port is used to carry traffic from multiple VLANs over a single physical connection. For example, if there is only one cable between two switches and both switches have VLAN 10, VLAN 20, and VLAN 30 configured, a trunk connection can carry traffic for all these VLANs over the same physical link.
A simple structure may look like this:
SWITCH 1 SWITCH 2
VLAN 10 ───────┐ ┌──── VLAN 10
VLAN 20 ───────┼─TRUNK──┼──── VLAN 20
VLAN 30 ───────┘ └──── VLAN 30
An access port is generally used for a single VLAN, while a trunk port can carry traffic for multiple VLANs. Trunk connections are especially common between switches.
What Is 802.1Q?
IEEE 802.1Q is a standard used for VLAN tagging in Ethernet networks. Since traffic from different VLANs is transmitted over the same physical cable on a trunk connection, the switch needs to determine which VLAN each Ethernet frame belongs to. 802.1Q solves this by adding a tag containing VLAN information to the Ethernet frame.
For example:
Frame → VLAN 10 tag
Frame → VLAN 20 tag
Frame → VLAN 30 tag
The switch on the other side checks the tag information to determine which VLAN the frame belongs to. This allows traffic from different VLANs to be distinguished while using the same trunk connection.
What Is a Native VLAN?
A Native VLAN is a special concept used with 802.1Q trunk connections. By default, traffic belonging to the Native VLAN may be transmitted across a trunk without a VLAN tag. For example, if VLAN 99 is configured as the Native VLAN on a trunk connection, appropriate untagged traffic received on that connection may be considered part of VLAN 99. It is important that the Native VLAN configuration matches on both sides of the trunk connection. Incorrect Native VLAN configuration can cause network problems and, in some cases, security risks.
What Is the Difference Between VLAN and LAN?
A LAN — Local Area Network is a local network created within a limited geographical area. For example, an internal network in an office or school can be considered a LAN. A VLAN, on the other hand, allows that network to be logically divided into multiple sections regardless of physical location.
In simple terms:
LAN → a physical and local network concept
VLAN → logical segmentation of a network
For example, an entire company office may operate on one LAN infrastructure, while separate VLANs can be created within that infrastructure for Finance, HR, IT, and Guest users.
Are VLAN and Subnet the Same Thing?
No. Although VLANs and subnets are related, they are not the same concept. A VLAN primarily creates logical network segmentation at Layer 2 — Data Link Layer of the OSI model. A subnet divides an IP network into smaller IP networks at Layer 3. In practical networks, a separate subnet is often used for each VLAN.
For example:
VLAN 10 → 192.168.10.0/24
VLAN 20 → 192.168.20.0/24
VLAN 30 → 192.168.30.0/24
This approach makes it possible to manage the network more systematically at both Layer 2 and Layer 3.
What Is Inter-VLAN Routing?
Different VLANs are separate Layer 2 networks, so direct communication between them does not normally occur. If a computer in VLAN 10 needs to communicate with a server in VLAN 20, the traffic must be routed through a Layer 3 device. This process is called Inter-VLAN Routing.
Inter-VLAN Routing can be performed using:
- a Router;
- a Layer 3 Switch.
For example:
VLAN 10
│
│
Layer 3 Switch
│
│
VLAN 20
The Layer 3 device routes traffic between networks belonging to different VLANs.
What Is Router-on-a-Stick?
Router-on-a-Stick is an approach used to perform routing between multiple VLANs through a single router interface. Different subinterfaces are created on the router’s physical interface.
For example:
GigabitEthernet0/0.10 → VLAN 10
GigabitEthernet0/0.20 → VLAN 20
GigabitEthernet0/0.30 → VLAN 30
The connection between the switch and router operates as a trunk. The router performs Layer 3 routing through a separate subinterface for each VLAN. In larger modern networks, Inter-VLAN Routing is also commonly performed using Layer 3 switches and SVIs.
What Is an SVI?
SVI — Switch Virtual Interface is a virtual interface created for a VLAN on a Layer 3 switch.
For example:
interface vlan 10
ip address 192.168.10.1 255.255.255.0
This IP address can be used as the default gateway for devices in VLAN 10. A Layer 3 switch can create multiple SVIs and perform routing between VLANs.
How Is VLAN Security Provided?
VLANs help logically segment a network, but a VLAN alone is not a complete security solution.
Additional mechanisms can be used to control which traffic is allowed to pass between VLANs:
- Firewall;
- Access Control List (ACL);
- Port Security;
- proper trunk configuration;
- disabling unused ports;
- network monitoring.
For example, users located in a Guest VLAN can be restricted from accessing the company’s internal servers using a Firewall or ACL. In this way, VLANs provide segmentation, while security policies control traffic between those segments.
What Is VLAN Hopping?
VLAN Hopping is a term used for Layer 2 security attacks in which an attacker attempts to send traffic to or gain access to a VLAN they are not intended to access. Such risks may be associated with incorrect trunk configuration and other weak network settings. For this reason, it is important to configure trunk ports correctly, disable unused ports, and apply appropriate network security rules. VLAN security is particularly important for professionals working in Network Administration and Cybersecurity.
What Are the Advantages of Using VLANs?
VLANs allow network administrators to create logical networks without changing the physical infrastructure.
The main advantages include:
- easier network management;
- smaller broadcast domains;
- separation of departments and user groups;
- more systematic application of security policies;
- separation of guest and corporate networks;
- more efficient use of physical hardware;
- greater flexibility when making network changes.
For example, even if an employee moves to another floor, the appropriate switch port configuration can allow them to remain in the same VLAN.
How Are VLAN Problems Identified?
If there is an error in the VLAN configuration, a device may be unable to access the network, communicate with other devices, or it may connect to an unintended network.
During troubleshooting, the following points are typically checked:
- Has the VLAN been created on the switch?
- Is the port assigned to the correct VLAN?
- Are Access and Trunk modes configured correctly?
- Is the required VLAN allowed across the trunk?
- Does the Native VLAN match on both sides?
- Are the IP address and subnet mask correct?
- Is the default gateway correct?
- Is Inter-VLAN Routing working?
- Are ACL or Firewall rules blocking the traffic?
On Cisco devices, commands such as:
show vlan brief
and
show interfaces trunk
can be used to check VLAN and trunk status. Systematically investigating network problems is an important part of the troubleshooting process.
What Should You Learn Before Studying VLANs?
To understand VLANs more effectively, it is useful to first learn the fundamental concepts of networking.
The following topics provide a strong foundation for VLANs:
- LAN and WAN;
- OSI Model;
- MAC Address;
- Switch and Router;
- IPv4 Addressing;
- Subnet Mask;
- Subnetting;
- Default Gateway;
- ARP;
- Ethernet.
After learning these topics, you can move on to VLAN, Access Port, Trunk, 802.1Q, STP, and Inter-VLAN Routing. At the next stage, you can expand your knowledge with topics such as DHCP, Routing, NAT, ACL, VPN, and network security.
If you want to learn VLAN, Switching, Subnetting, Routing, DHCP, NAT, VPN, and other networking technologies through hands-on practice with real Cisco, MikroTik, and other network devices, you can explore JET Academy’s IT Specialist course.
