appzasGamesToolsDevLearnCheat sheetsQuick calcsConvertersReferenceNetworkTimeCalculatorsCompareLLM prices

Subnets and CIDR

Lesson 2 of 310 minBeginner

Read /24, count hosts and split networks.

A subnet is a slice of a network. CIDR notation writes it as an address plus the number of bits that identify the network: 192.168.1.0/24 means the first 24 bits are the network and the last 8 are for hosts.

CIDRSubnet maskAddressesUsable 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

The formula: addresses = 2 to the power of (32 minus the prefix). Two are reserved in a normal subnet: the first is the network address and the last is the broadcast address, so usable hosts = addresses minus 2.

Worked example

Take 192.168.1.0/26. There are 2^6 = 64 addresses, from 192.168.1.0 to 192.168.1.63. The network address is .0, the broadcast is .63 and the usable hosts are .1 to .62 (62 hosts). The next /26 starts at 192.168.1.64.

NoteCloud providers often reserve a few more addresses per subnet. Check your provider before sizing a subnet tightly.

Test yourself

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

1. How many usable hosts does a /24 have?
2. What is the broadcast address of 192.168.1.0/26?
3. How many addresses does a /28 contain?
4. What is the subnet mask of /24?

Key terms