VLAN

VLAN is a logical grouping of network endpoints connected to defined ports on a switch, allowing the segmentation of networks by creating logical broadcast domains that can span multiple physical LAN segments.

Department VLAN ID Subnet
Servers VLAN 10 192.168.1.0/24
C-Level VLAN 20 192.168.2.0/24
Finance VLAN 30 192.168.3.0/24
HR VLAN 40 192.168.4.0/24
Marketing VLAN 50 192.168.5.0/24
Support VLAN 60 192.168.6.0/24

VLAN Identification

Standard 802.3 Ethernet frames do not contain VLAN information; therefore, switches and other VLAN-enabled devices need a mechanism to keep track of all the VLAN information associated with a packet while traversing VLAN-enabled devices. Two main trunking methods are utilized to achieve this, ISL and IEEE 802.1Q.

IEEE 802.1Q

To ensure interoperability of VLAN technologies from the various network-equipments vendors, the Institute of Electrical and Electronics Engineers (IEEE) developed the 802.1Q specification in 1998.

  • The IEEE 802 committee had to change the IEEE 802.3 Ethernet frame format by adding a pair of 2-byte fields, TPID and TCI (which consists of three subfields, PCPDEI, and VID), resulting in a VLAN-compliant 802.1Q Ethernet frame.

Diagram showing conversion of a 802.3 Ethernet frame to a 802.1Q Ethernet frame by inserting a 802.1Q header between the source address and length fields. The 802.1Q header includes TPID, PCP, DEI, and VID.

Assigning NICs a VLAN in Linux

sudo modprobe 8021q
lsmod | grep 8021
sudo vconfig add eth0 20