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.
| VLAN | Subnet | Gateway | DHCP pool |
|---|---|---|---|
| 10 lan | 192.168.0.0/25126 usable | 192.168.0.1 | 192.168.0.12 – 192.168.0.126 |
| 20 iot | 192.168.0.128/2662 usable | 192.168.0.129 | 192.168.0.140 – 192.168.0.190 |
| 30 guest | 192.168.0.192/2662 usable | 192.168.0.193 | 192.168.0.204 – 192.168.0.254 |
| 99 mgmt | 192.168.1.0/2814 usable | 192.168.1.1 | 192.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
- 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.
- List one VLAN per line as "name, VLAN id, devices". Count the devices generously — phones, IoT gadgets and VMs add up.
- Set how many static addresses you want after the gateway (servers, printers, access points); the DHCP pool starts after them.
- 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
- Allocating the largest subnets first keeps every subnet aligned to its own size, so none overlaps and no space is wasted between them.
- VLAN 1 is the default (untagged) VLAN on most switches; many admins avoid using it for production traffic. Valid VLAN ids are 1–4094.
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
- IPv4 subnet (CIDR) calculator — Network, broadcast, netmask, wildcard and host range of any IPv4 CIDR, and how to split it into smaller subnets.
- IPv6 subnet calculator — Network, address range and number of /64s of any IPv6 prefix, compressed and expanded, and how to split it per LAN.
- MikroTik RouterOS config generator — A clean RouterOS 7 starting config: LAN bridge, DHCP or PPPoE internet, DHCP server, NAT and a stateful firewall.
Formulas reviewed November 27, 2026 by Novian · runs entirely in your browser · methodology