Subnetting means splitting one network into smaller ones. It keeps networks organized, limits broadcast traffic, and lets you separate groups of devices for security.

CIDR notation

CIDR writes the mask as a slash and the number of network bits. /24 means 24 network bits, which equals 255.255.255.0.

/24 = 255.255.255.0
/25 = 255.255.255.128
/26 = 255.255.255.192
/27 = 255.255.255.224
/28 = 255.255.255.240
/30 = 255.255.255.252

The number of host bits is 32 - prefix. The number of usable hosts is 2^(host bits) - 2 (subtracting the network and broadcast addresses).

  • /24: 8 host bits, 254 usable hosts
  • /26: 6 host bits, 62 usable hosts
  • /30: 2 host bits, 2 usable hosts (good for router-to-router links)

Worked example

Split 192.168.1.0/24 into four equal subnets.

  • Four subnets need 2 extra bits (2^2 = 4), so the new prefix is /26.
  • Block size is 256 – 192 = 64 in the last octet.
  • The subnets start at 0, 64, 128 and 192.
192.168.1.0/26    hosts .1-.62     broadcast .63
192.168.1.64/26   hosts .65-.126   broadcast .127
192.168.1.128/26  hosts .129-.190  broadcast .191
192.168.1.192/26  hosts .193-.254  broadcast .255

A quick method for any address

To find which subnet a host belongs to, such as 192.168.1.77/26:

  • Block size is 64, so the subnet boundaries are 0, 64, 128, 192.
  • 77 falls between 64 and 127, so the network address is 192.168.1.64.
  • The broadcast address is one less than the next boundary: 192.168.1.127.
  • The usable range is .65 to .126.

Planning tips

  • List the largest group first, then fit smaller groups after it.
  • Always add room for growth. A department of 50 devices needs a /26, not a /27.
  • Check that two subnets never overlap, because overlapping ranges cause hard-to-find routing faults.

Check your understanding

What subnet mask matches /27?

  • 255.255.255.192
  • 255.255.255.224
  • 255.255.255.240
  • 255.255.255.248

Answer: 255.255.255.224 A /27 uses 27 network bits, so the last octet has 3 bits on: 128 + 64 + 32 = 224.

How many usable host addresses are in a /28?

  • 6
  • 14
  • 30
  • 62

Answer: 14 A /28 has 4 host bits, so 2^4 – 2 = 14.

Which network does host 10.0.0.150/25 belong to?

  • 10.0.0.0/25
  • 10.0.0.64/25
  • 10.0.0.128/25
  • 10.0.0.192/25

Answer: 10.0.0.128/25 A /25 has a block size of 128, so 150 falls in the block that starts at 128.

Which prefix is the best fit for a link between two routers?

  • /24
  • /28
  • /30
  • /32

Answer: /30 A /30 has exactly 2 usable addresses, enough for both ends and nothing wasted.