Skip to content
Tape and Square

N-03 · Networking

VLAN planner

List your networks and how many devices each needs. The planner carves the parent block into right-sized subnets, largest first, and gives you a table to paste into your docs or router.

Gateway
Networks

Count the devices only; each network also gets a gateway address.

Allocation · 10.0.0.0/23

304 of 512 addresses

5 networks fit. 208 addresses left for later.

1020304099free10.0.0.010.0.1.010.0.1.255

NOTEIoT has 60 devices and room for 61. At 62 it needs a /25 and the plan shifts.

  • Trusted VLAN 10100 / 125

    10.0.0.0/25

    gw 10.0.0.1 · dhcp .2–.126

  • IoT VLAN 2060 / 61

    10.0.0.128/26

    gw 10.0.0.129 · dhcp .130–.190

  • Guest VLAN 3040 / 61

    10.0.0.192/26

    gw 10.0.0.193 · dhcp .194–.254

  • Cameras VLAN 4020 / 29

    10.0.1.0/27

    gw 10.0.1.1 · dhcp .2–.30

  • Management VLAN 9910 / 13

    10.0.1.32/28

    gw 10.0.1.33 · dhcp .34–.46

  • Free

    10.0.1.48/28 · 10.0.1.64/26 · 10.0.1.128/25

Preview Markdown export
| VLAN | Name       | Subnet        | Mask            | Gateway    | DHCP range            | Devices / max |
|------|------------|---------------|-----------------|------------|-----------------------|---------------|
| 10   | Trusted    | 10.0.0.0/25   | 255.255.255.128 | 10.0.0.1   | 10.0.0.2–10.0.0.126   | 100 / 125     |
| 20   | IoT        | 10.0.0.128/26 | 255.255.255.192 | 10.0.0.129 | 10.0.0.130–10.0.0.190 | 60 / 61       |
| 30   | Guest      | 10.0.0.192/26 | 255.255.255.192 | 10.0.0.193 | 10.0.0.194–10.0.0.254 | 40 / 61       |
| 40   | Cameras    | 10.0.1.0/27   | 255.255.255.224 | 10.0.1.1   | 10.0.1.2–10.0.1.30    | 20 / 29       |
| 99   | Management | 10.0.1.32/28  | 255.255.255.240 | 10.0.1.33  | 10.0.1.34–10.0.1.46   | 10 / 13       |

How the planner allocates

Each network gets the smallest block that holds its devices, a gateway, and the network and broadcast addresses. The planner sorts networks from largest to smallest (networks of the same size keep the order you entered them) and places each one right after the last. Placing big blocks first keeps every block aligned on a multiple of its own size and leaves the free space in one run at the end.

Formula

Prefix
32 − ⌈log2(devices + 3)⌉
Block size
2(32 − prefix)

The 3 is the gateway plus the network and broadcast addresses. One device still gets a /30: the device and its gateway.

Worked example

Trusted needs 100 devices. 100 + 3 = 103, and the next power of two is 128, so it gets a /25 at 10.0.0.0. IoT needs 60: 63 rounds up to 64, a /26, which starts at the next 64-address boundary, 10.0.0.128. The whole plan uses 304 of 512 addresses in 10.0.0.0/23.

Gateways and DHCP

The gateway goes on the first usable address by default, the convention in Cisco's design guides and training labs, the major cloud providers and most home routers. Pick “Last IP” if your network uses the top address instead. The DHCP range is every other usable address; carve out room for printers, servers and other fixed addresses in your DHCP server if you need it.

VLAN IDs

An 802.1Q tag has a 12-bit VLAN ID. 0 and 4095 are reserved, so switches accept 1 to 4094. VLAN 1 is the default VLAN on most switches, and many networks keep it unused. Cisco Catalyst switches also reserve 1002–1005. The planner accepts any ID from 1 to 4094, notes those two cases, and flags a repeated ID.

References

  • RFC 4632, Classless Inter-domain Routing (CIDR); RFC 1878, Variable Length Subnet Table for IPv4.
  • IEEE 802.1Q, Table 9-2 Reserved VID values; Cisco Catalyst, Juniper, Arista and MikroTik VLAN configuration guides.
  • Cisco, IP Addressing and Subnetting for New Users (VLSM example); Cisco Networking Academy VLSM lab 11.10.2.
  • RFC 4180, Common Format for Comma-Separated Values; GitHub Flavored Markdown spec, tables.

Embed this calculator

Free to use on your site. Paste this where the calculator should appear; preview it.