← All insights
Learning ITNovember 20269 min read

Subnetting Made Simple: A Step-by-Step Method With Worked Examples

Subnetting looks like magic until you see that it is only counting in blocks. This guide teaches one simple method, with a cheat sheet and worked examples you can check by hand.

A terminal window with network commands, used to practise subnetting

An IPv4 address has 32 bits, written as four numbers from 0 to 255, for example 192.168.10.77. A mask says how many of those bits identify the network and how many identify the host. The mask can be written as 255.255.255.192 or, shorter, as /26 (26 bits for the network). They mean the same thing.

The cheat sheet

Learn these last-octet values once. Everything else follows from them.

PrefixLast octet of the maskAddresses in a blockUsable hosts
/240256254
/25128128126
/261926462
/272243230
/282401614
/2924886
/3025242

Usable hosts are always two fewer than the block, because the first address names the network and the last one is the broadcast address.

The block-size method

  1. Take the last octet of the mask and subtract it from 256. That is the block size. For 192: 256 − 192 = 64.
  2. Count up from 0 in steps of the block size: 0, 64, 128, 192. These are the network addresses.
  3. The broadcast address of each subnet is one less than the next network address.
  4. The usable range is everything between the network and the broadcast address.

Worked example 1: split a /24 into four subnets

You have 192.168.10.0/24 and need four equal subnets, one for each department. Four subnets need 2 extra bits (2² = 4), so the new prefix is /26. The block size is 64.

SubnetNetworkUsable rangeBroadcast
1192.168.10.0/26192.168.10.1 to 192.168.10.62192.168.10.63
2192.168.10.64/26192.168.10.65 to 192.168.10.126192.168.10.127
3192.168.10.128/26192.168.10.129 to 192.168.10.190192.168.10.191
4192.168.10.192/26192.168.10.193 to 192.168.10.254192.168.10.255

Each subnet holds 62 usable hosts.

Worked example 2: which subnet does a host belong to?

A computer has the address 192.168.10.77/26. Block size 64, so the networks start at 0, 64, 128, 192. The number 77 lies between 64 and 128, so the computer is in the 192.168.10.64/26 subnet. Its network address is .64 and its broadcast address is .127.

Why this matters: two computers can only talk directly if they are in the same subnet. If one is .70 and the other is .130, they are in different subnets and need a router between them.

Worked example 3: how big a subnet do I need?

You need a subnet for 30 devices. Look for the smallest block whose usable hosts are at least 30. A /27 gives 32 addresses and 30 usable hosts, which is exactly enough. But if you expect to grow, choose a /26 (62 usable hosts) so you do not have to renumber the network next year.

Different sizes for different needs (VLSM)

You do not have to cut a network into equal parts. A small link between two routers needs only 2 addresses, so a /30 is enough, while a staff network may need a /26. Allocate the largest subnets first, then fit smaller ones after them, so nothing overlaps. This is called variable-length subnet masking.

Five mistakes to avoid

  • Forgetting to subtract two from the block size when counting usable hosts.
  • Counting the broadcast address as a usable host.
  • Starting a subnet at an address that is not a multiple of the block size.
  • Letting two subnets overlap when you plan by hand.
  • Giving a link between two routers a whole /24. Use a /30 and save the rest.

Practise until it is automatic

Do five problems a day for a week: pick a random address and a prefix, then write down the network address, the broadcast address and the usable range. Check each one with a calculator. After about fifty problems you will no longer need the table.

If you need your office network planned, documented or fixed in Abuja, our engineers do exactly this for businesses. Send us a message on WhatsApp.

Check Your Answers With the Subnet Calculator

Learn.GT has a free subnet calculator. Work each problem by hand first, then use it to see whether you got it right.

Open the Subnet Calculator