FREE TOOL

VLSM subnet planner

Enter a parent prefix and the number of hosts each site needs. The planner gives each site the smallest subnet that holds its hosts, places the largest subnets first, and lists the address space that is left over. Each placement comes with its binary working, and you can download the plan as a CSV file. The planning runs in this page, and the page does not send what you enter to a server. No account is required.

Parent prefix and sites

This planner runs in your browser and needs JavaScript turned on. The boxes stay locked until the page script loads, so the page cannot send anything you enter. If they stay locked, the script did not load. Turn on JavaScript or reload the page to use the planner.

For example 10.40.0.0/22, or 10.40.0.0 255.255.252.0.

One site per line: a name, a comma, and the number of hosts, such as Warehouse, 50. A line with only a number gets a numbered name. You can list up to 64 sites, with names of up to 40 characters.

One prefix per line that no site may use, such as a block kept for infrastructure. You can list up to 16 blocks, and each must sit inside the parent.

How the planner sizes each site

A subnet with h host bits has 2h addresses. The first is the network address and the last is the broadcast address, so 2hminus 2 are left for hosts. The planner gives each site the smallest subnet whose host addresses cover the count you entered. A site that needs 50 hosts gets a /26, because a /27 has only 30 host addresses and a /26 has 62, which leaves 12 to spare. If you expect a site to grow, add the growth to its host count before you plan.

Why the smallest subnet is a /30

A /30 has four addresses and two host addresses, which makes it the smallest ordinary subnet. RFC 3021 allows a /31 on a point-to-point link, where both addresses are usable because a link between two devices needs no broadcast address. The planner does not know which of your sites are point-to-point links, so it never assigns a /31 or a /32 for a host count. A site that needs 1 or 2 hosts gets a /30. If a link supports a /31, you can carve one from the unallocated space yourself.

How the planner places the subnets

The planner sorts the sites from the largest subnet to the smallest. Sites that need the same size keep the order you entered them, so the same input always gives the same plan. Each subnet starts at the lowest address whose host bits are all 0 and whose whole subnet is free and inside the parent. A /26 has 6 host bits, so it can start only on a multiple of 64, such as .0, .64, .128 or .192. A free starting address is not enough, because the planner skips any start whose subnet would include a reserved address or a site already placed. Without reserved blocks, placing the largest subnets first lets each smaller subnet start right after the one before it, because every larger size is a multiple of every smaller one, so no addresses are skipped between sites. A reserved block can leave a gap, because a site whose subnet would include a reserved address moves to the next start of its own size where the whole subnet is free.

To practice, plan Cisco's VLSM example on paper first: 192.168.5.0/24, with sites that need 14, 28, 2, 7 and 28 hosts. Then enter it here and compare your subnets with each placement in the working.

Reserved blocks and unallocated space

Enter any prefix that no site may use, such as a block you keep for infrastructure, in the reserved box. Each reserved block must sit inside the parent, and reserved blocks may not overlap each other. The planner places the sites around them. Every address the plan does not use is listed as unallocated, written as the fewest aligned prefixes. The last working step checks that the allocated, reserved and unallocated addresses add up to the size of the parent.

When the sites do not fit

If the subnets need more addresses than the parent has, the planner says how many addresses are missing and does not return a partial plan. It also stops when one site needs a subnet larger than the whole parent. Reserved blocks can leave enough addresses free in total while every aligned subnet of the size a site needs still includes a reserved address or a site already placed, and the planner reports that case separately. In each case the working shows the subnets placed before the plan stopped.

What the CSV file contains

Download CSV saves the address map as a file that this page builds, with one row for each site, reserved block and unallocated block. Every field is in double quotes. A site name that starts with =, +, -, or @ gets an apostrophe in front, so a spreadsheet shows the name as text instead of running it as a formula.

What this planner does not do

The planner uses one method, largest subnet first, on one IPv4 parent at a time. Other valid layouts exist, and a network that is already running may use its addresses in a different order, so compare the plan with what is deployed before you configure anything. The planner does not plan IPv6, does not assign /31 point-to-point links, and does not flag special-purpose ranges such as 127.0.0.0/8 for loopback.

Sources: RFC 4632, Classless Inter-domain Routing; RFC 1122, section 3.2.1.3, for the reserved network and broadcast host numbers; RFC 3021, 31-bit prefixes on point-to-point links; Cisco, Configure IP Addresses and Unique Subnets for New Users, for the VLSM example; RFC 4180, the CSV format; OWASP, CSV injection.