VLANs and Trunking

VLANs and Trunking Visually

Learn about Virtual Local Area Networks (VLANs) and trunking protocols through interactive visualizations. Understand how VLANs segment networks, improve security, and optimize traffic flow.

Network Segmentation Network Segmentation Security Trunking VLAN Tagging IEEE 802.1Q

What are VLANs?

A Virtual Local Area Network (VLAN) is a logical grouping of network devices that behave as if they are on the same physical network segment, even if they are physically located on different network segments. VLANs allow network administrators to segment a single physical network into multiple logical networks.

Network Switch
VLAN 10
VLAN 10
VLAN 20
VLAN 20
VLAN 30
VLAN 30

How VLANs Work

VLANs work by tagging network frames with a VLAN identifier (VLAN ID). This tagging allows switches to determine which VLAN a frame belongs to and forward it only to ports that are members of that VLAN. The IEEE 802.1Q standard defines the VLAN tagging mechanism.

VLAN 10 (Sales)
VLAN 20 (Marketing)
VLAN 30 (Engineering)
Access Ports
Trunk Ports

Benefits of VLANs

1

Network Security

VLANs isolate traffic between different departments or user groups, preventing unauthorized access to sensitive data. Devices in one VLAN cannot directly communicate with devices in another VLAN without a router.

2

Traffic Management

VLANs reduce network congestion by limiting broadcast domains. Broadcast traffic is only forwarded within the VLAN, reducing unnecessary traffic on other network segments.

3

Flexibility

VLANs allow network administrators to logically group devices regardless of their physical location. Users can be moved between VLANs without changing physical connections.

4

Simplified Network Management

VLANs simplify network administration by allowing centralized management of network policies and security rules. Changes can be made through software configuration rather than physical rewiring.

What is Trunking?

Trunking is a technique used to carry traffic from multiple VLANs over a single physical link. A trunk port can carry traffic for all configured VLANs, identified by VLAN tags in the frame headers. This allows switches to connect to each other and carry traffic for multiple VLANs efficiently.

Trunking Process Steps

1

Frame Reception

When a switch receives a frame from an access port, it associates the frame with the VLAN configured for that port.

2

VLAN Tagging

The switch adds an 802.1Q tag to the frame header containing the VLAN ID before forwarding it to a trunk port.

3

Trunk Transmission

The tagged frame is transmitted over the trunk link to another switch, which can identify the VLAN based on the tag.

4

Frame Delivery

The receiving switch removes the VLAN tag and forwards the frame only to ports that are members of the specified VLAN.

VLAN Configuration

VLANs are configured on network switches through various methods. The most common approach is to assign switch ports to specific VLANs, creating access ports. Trunk ports are configured to carry traffic for multiple VLANs.

VLAN Configuration Steps

1

Plan VLAN Structure

Determine the number of VLANs needed and assign VLAN IDs. Plan which devices will belong to each VLAN based on department, function, or security requirements.

2

Create VLANs

Use switch commands to create VLANs and assign descriptive names. For example: vlan 10
name Sales

3

Assign Ports to VLANs

Configure switch ports as access ports and assign them to specific VLANs. For example: interface fastethernet 0/1
switchport mode access
switchport access vlan 10

4

Configure Trunk Ports

Set up trunk ports to carry traffic for multiple VLANs. For example: interface fastethernet 0/24
switchport mode trunk
switchport trunk allowed vlan 10,20,30