Skip to content
Log In Sign Up info@muvcloud.com

The Short Answer

A VLAN groups switch ports, or tagged traffic on a link, into one broadcast domain. Devices in VLAN 10 and devices in VLAN 20 can be connected to the same switches and still not see each other: broadcasts, ARP requests, and DHCP stay inside their own VLAN. To the devices, each VLAN looks like a separate physical network.

The 802.1Q Tag

The IEEE 802.1Q standard marks a frame by inserting a four-byte tag into the Ethernet header. The tag carries a 12-bit VLAN ID, so IDs run from 1 to 4094; 0 and 4095 are reserved. Switches read the tag to decide which ports a frame may reach. On many switches, VLAN 1 is the default VLAN that every port belongs to until it is configured.

Access Ports and Trunk Ports

Port typeCarriesTypical use
AccessOne VLAN, untaggedA server or PC
TrunkMany VLANs, taggedSwitch to switch

A device on an access port never sees a tag: the switch adds it when a frame enters and removes it when the frame leaves. A trunk carries several VLANs over one cable, each frame tagged with its VLAN ID. One VLAN on a trunk can travel untagged, the native VLAN. A server can be connected to a trunk too; it then creates one interface per VLAN itself.

What VLANs Are For

  • Isolation: management interfaces, storage traffic, and public traffic each get their own VLAN.
  • Smaller broadcast domains: a broadcast reaches only the hosts of one VLAN.
  • Private networks between servers: servers can talk over a VLAN that carries no internet traffic. Whether such a network exists and how it reaches a server varies by provider.
  • Flexibility: moving a device to another network is a switch setting, not a new cable.

Traffic Between VLANs Needs a Router

Hosts in different VLANs cannot reach each other directly, even on the same switch. Traffic between them passes a router, a layer-3 switch, or a firewall, which is also the natural place for rules about what may cross. Each VLAN normally has its own subnet and its own gateway address on that router.

VLAN vs Subnet

A VLAN is a layer-2 boundary: which devices share a broadcast domain. A subnet is a layer-3 idea: which IP addresses are reached directly; see what is a subnet. The usual design maps one subnet to one VLAN. Two subnets on one VLAN work but share broadcasts and are not isolated from each other. The layers themselves are explained in the OSI model, and the layer-2 addresses in what is a MAC address.

A VLAN Interface on Linux

Work on an interface that does not carry your SSH session, or keep the console in your provider's control panel open: a mistake on the main interface cuts the connection. To create VLAN 100 on eth1 for a test:

sudo ip link add link eth1 name eth1.100 type vlan id 100
sudo ip addr add 10.10.100.2/24 dev eth1.100
sudo ip link set eth1.100 up
ip -d link show eth1.100

The detailed output names the VLAN protocol and ID. These commands do not survive a reboot. To make the interface permanent on Ubuntu, add a vlans section to the Netplan file:

network:
  version: 2
  ethernets:
    eth1: {}
  vlans:
    vlan100:
      id: 100
      link: eth1
      addresses: [10.10.100.2/24]

Apply it with sudo netplan try, which rolls back unless you confirm. Netplan basics are in how to configure a static IP with Netplan. On AlmaLinux and Rocky Linux, NetworkManager creates the same interface:

sudo nmcli connection add type vlan con-name vlan100 ifname vlan100 \
  vlan.parent eth1 vlan.id 100 \
  ipv4.method manual ipv4.addresses 10.10.100.2/24

The switch port must carry VLAN 100 tagged, or no traffic arrives on the new interface.

VXLAN in One Sentence

VXLAN carries layer-2 frames inside UDP packets across a routed network, with a 24-bit network ID that allows about 16 million segments instead of 4094, which is why large virtualization and container platforms use it to build networks that span many hosts.

Updated:

Linux VPS with Full Root Access

MUVCloud cloud servers run on KVM with Enterprise NVMe SSD storage and full root access, in Turkey, the Netherlands, and the USA.

Cloud VPS Plans Starting at2.99 $/mo Cheap Linux VPS

No Limits on Service or Support

You are not on your own as your projects grow. Our support engineers are ready 24/7, on several channels, whenever you need them.

Support specialist
  • 100% customer satisfaction goal
  • Our own hardware
  • 24/7 ticket and email support
  • 4 countries with locations