Home Lab Networking with VLANs

A complete guide to VLANs, trunking, inter-VLAN routing, and DHCP for your homelab.

6 min read

Why VLANs Matter

A flat network works fine for a handful of devices. But as your homelab grows -- servers, VMs, IoT devices, guest Wi-Fi, management interfaces -- a single broadcast domain becomes a problem. VLANs solve this by creating logical networks on physical hardware, giving you segmentation, security boundaries, and better traffic management without buying more switches.

For someone with a Cisco networking background like myself, VLANs are second nature. But even if you're new to networking, the concepts are straightforward once you see them in action.

VLAN Design for Homelabs

Start with a simple numbering scheme. I use this pattern and it scales well:

Keep your native VLAN (VLAN 99) different from any traffic-carrying VLAN. This prevents VLAN hopping attacks. Never use VLAN 1 for user traffic -- it's the default on virtually every switch and is a well-known attack vector.

Trunk Ports and Access Ports

Understanding the difference between trunk and access ports is fundamental:

On Brocade ICX switches (which I use extensively), trunk configuration looks like this:

interface 1/1/1
switchport mode trunk
switchport trunk allowed vlan 10,20,30,40,50
no shutdown

Be explicit about which VLANs are allowed on trunks. Don't use the default "allow all" -- it's a security risk and makes troubleshooting harder.

Inter-VLAN Routing

VLANs are isolated by default. To allow communication between them, you need routing. There are three common approaches:

For a homelab, OPNsense or pfSense as a router-on-a-stick is the most popular approach. Create sub-interfaces for each VLAN, assign them IP addresses, and configure firewall rules between them.

DHCP Design

Each VLAN needs its own DHCP scope. You have two main options:

Reserve IP addresses for network infrastructure (switches, APs, firewalls) outside the DHCP pool. Document your IP scheme so you're not guessing later:

VLAN Security Best Practices

Wi-Fi and VLANs

Wireless access points are ideal VLAN endpoints. Most enterprise-grade APs (Ubiquiti, Aruba, Ruckus) support SSID-to-VLAN mapping:

Troubleshooting VLANs

Common VLAN issues and how to fix them:

Use show vlan brief, show interfaces trunk, and show ip interface brief as your primary troubleshooting commands on Cisco/Brocade gear.