appzasGamesToolsDevLearnCheat sheetsQuick calcsConvertersReferenceNetworkTimeCalculatorsCompareLLM prices

Subnetting and CIDR

Lesson 2 of 412 minIntermediate

Split a network into subnets and calculate sizes by hand.

An IPv4 address has 32 bits. The prefix length after the slash says how many leading bits identify the network. The remaining bits identify hosts.

Number of addresses in a block = 2^(32 - prefix). Usable hosts = that number minus 2 (the network address and the broadcast address).

CIDRMaskAddressesUsable hosts
/24255.255.255.0256254
/25255.255.255.128128126
/26255.255.255.1926462
/27255.255.255.2243230
/28255.255.255.2401614
/30255.255.255.25242

Example: split 192.168.10.0/24 into four equal subnets

Four subnets need 2 extra bits, so each is a /26 with 64 addresses:

  • 192.168.10.0/26 (hosts .1 to .62, broadcast .63)
  • 192.168.10.64/26 (hosts .65 to .126, broadcast .127)
  • 192.168.10.128/26 (hosts .129 to .190, broadcast .191)
  • 192.168.10.192/26 (hosts .193 to .254, broadcast .255)

Private ranges

Three blocks are reserved for private networks and are not routed on the internet: 10.0.0.0/8, 172.16.0.0/12 and 192.168.0.0/16.

CarefulPlan address ranges so they do not overlap between sites, VPNs or cloud networks. Overlapping ranges are one of the most common causes of "the VPN connects but nothing works".

Test yourself

Answer all the questions, then check them. Finish with every answer right to mark the lesson as done.

1. How many usable host addresses does a /26 have?
2. Which is a private address?
3. You split a /24 into 8 equal subnets. What is the new prefix?

Key terms