Skip to content
runonprem

Networking

VLAN & subnet planner

Plan VLANs for a home lab or small office: give each VLAN the smallest subnet that fits its devices, carved out of one address block without overlaps, with gateway and DHCP pool ready to type into your router or firewall.

VLANSubnetGatewayDHCP pool
10 lan192.168.0.0/25126 usable192.168.0.1192.168.0.12 – 192.168.0.126
20 iot192.168.0.128/2662 usable192.168.0.129192.168.0.140 – 192.168.0.190
30 guest192.168.0.192/2662 usable192.168.0.193192.168.0.204 – 192.168.0.254
99 mgmt192.168.1.0/2814 usable192.168.1.1192.168.1.12 – 192.168.1.14

272 of 1,024 addresses allocated; the rest of the block stays free for later VLANs.

How to use it

  1. Pick one private block for all VLANs, e.g. 10.10.0.0/16 or 192.168.0.0/22, that does not clash with networks you reach over VPN.
  2. List one VLAN per line as "name, VLAN id, devices". Count the devices generously — phones, IoT gadgets and VMs add up.
  3. Set how many static addresses you want after the gateway (servers, printers, access points); the DHCP pool starts after them.
  4. Copy each subnet, gateway and DHCP pool into your router, firewall (OPNsense, pfSense, RouterOS, UniFi) and switch configuration.

Formula and method

needed      = devices + 1 (gateway)
prefix      = longest /p with 2^(32 − p) − 2 ≥ needed   (at most /30)
allocation  = largest subnet first, each starting where the previous one ended
gateway     = first usable address
DHCP pool   = gateway + 1 + static addresses … last usable address

Worked example

In 192.168.0.0/22 (1,024 addresses): lan with 100 devices needs 101 addresses → /25 (126 usable) = 192.168.0.0/25, gateway 192.168.0.1, DHCP from .12 with 10 static addresses. iot (50 → /26) gets 192.168.0.128/26, guest (30 → /26, because a /27 has only 30 usable) gets 192.168.0.192/26 and mgmt (10 → /28) gets 192.168.1.0/28. 272 addresses are used; the rest stays free.

FAQ

Why does a VLAN with 30 devices get a /26?

A /27 has 32 addresses, of which 30 are usable after the network and broadcast addresses. With the gateway you need 31, so the next size up, a /26 with 62 usable addresses, is required.

Which VLANs should a home lab have?

Common choices are a trusted LAN, a management VLAN for switches and hypervisors, an IoT VLAN, a guest VLAN and a DMZ for services exposed to the internet, with firewall rules between them.

Can I add VLANs later?

Yes. The planner leaves the unused part of the block free. To keep the existing subnets unchanged, add new VLANs at the end of the list or plan a larger base block from the start.

Related tools

Formulas reviewed November 27, 2026 by Novian · runs entirely in your browser · methodology