Networking / LOCAL TOOL

Subnet Planner

Divide a block into subnets by host count, around the allocations you already have.

Runs locally — input is never uploaded
The block on line one, then "web 100" or "db /26" per subnet
ResultReady when you are

WHAT IT DOES

Fit the subnets you need into the block you were given.

Put the block on the first line and the subnets under it, sized by host count or by prefix. The plan places the largest first, works around any allocation that already exists, and reports the free space that is left. Every placed subnet is printed in the same form the tool reads, so a line can be pasted back to pin it there while the rest are replanned around it.

Why use it?

Use it to fit new subnets around existing allocations without accidentally renumbering deployed networks.

How to use this tool

  1. Put the parent CIDR on the first line and one named requirement on each following line. For example: 10.0.0.0/22, then web 100 and db 20 on separate lines.
  2. Pin an existing allocation with a line such as legacy = 10.0.1.0/24. Use prefixes rather than host counts for IPv6.
  3. Plan and review both placed and unplaced requests, plus the remaining free blocks. Total free space alone does not guarantee an aligned subnet fits.
  4. Save the resulting allocation text with your network documentation; the tool does not reserve addresses on a network.

Details and limitations

  • Subnets are placed largest first. Placing a small one before a large one strands the space the large one needed, and no amount of free addresses afterwards makes up for it.
  • A subnet must start on a multiple of its own size, so a plan can fail for want of alignment while plenty of addresses remain free. When that happens the reason says so rather than reporting the block as full.
  • Sizing by host count reserves the network and broadcast addresses, so 100 hosts is a /25 rather than a /26. Write a prefix outright when you want the /31 point-to-point or /32 single-host case.
  • A line written as name = 10.0.1.0/24 is an allocation that already exists. It is kept exactly where it is and everything else is fitted around it, which is how a plan grows without renumbering what is already deployed.
  • IPv6 blocks are planned by prefix rather than by host count, because a /64 holds more addresses than any host count means anything against.
  • Nothing is stored between visits. The plan you paste is the only state there is, and a placed subnet is printed as "name: block" -- the same form a fixed allocation is written in -- so keeping the plan is a matter of keeping that text wherever your other documentation lives.

WORKED EXAMPLES

Fit new allocations around a deployed subnet

The legacy block is fixed. Plan two new requirements around it rather than treating every existing address as available.

Parent and requirements

10.0.0.0/22
legacy = 10.0.1.0/24
web 100
db 20

Expected result

web receives 10.0.0.0/25 and db receives 10.0.0.128/27; legacy stays at 10.0.1.0/24. Copying this plan does not reserve or configure those networks.

COMMON QUESTIONS

Subnet Planner questions

What is VLSM?
Variable-length subnet masking: giving each subnet the size it needs instead of splitting a block into equal pieces. A /24 divided evenly into four /26s wastes most of a /26 on a link that needs two addresses, while VLSM gives that link a /30 and leaves the rest whole.
Why did a subnet fail to fit when there is space left?
Because a subnet has to begin on a multiple of its own size. A /25 cannot start halfway through a /24 even when 128 addresses are free there. The reason given names the largest remaining gap so you can see whether the problem is space or alignment.
Can I keep the subnets I have already deployed?
Yes. Write them as name = 10.0.1.0/24 and they stay exactly where they are, with everything else placed around them. Overlaps between fixed allocations, or one that falls outside the parent block, are reported rather than quietly moved.
Does the tool remember my plan?
No. It holds nothing between visits, which for a document describing the inside of a network is the only sensible arrangement. Each placed subnet is printed as "name: block", which is the same form a fixed allocation is written in, so keep those lines in your repository or wiki and paste them back when the plan needs to change.