Hosts per Subnet
The most common subnetting question is the simplest arithmetic one: given a prefix, how many hosts does this subnet hold? This lesson teaches one method and drills it until it is automatic.
The one method to learn first
Before any tricks, before any tables, the exam expects you to be able to derive the answer from first principles. Here is the method you should use until it is reflex.
h = 32 − prefix. Step 2. Total addresses = 2h. Step 3. Usable hosts = 2h − 2.Every question about “how many hosts fit here” is those three steps. The prefix is given; subtraction gives the host bits; a power of 2 gives the address count; subtract 2 for the network and broadcast addresses. If you memorise nothing else, memorise this.
32 − prefix for the common masks if you remember the host-bit ladder: /24→8, /25→7, /26→6, /27→5, /28→4, /29→3, /30→2. Each step up the prefix removes exactly one host bit, which halves the address count. That halving is why the numbers go 256, 128, 64, 32, 16, 8, 4.Worked drills from /24 to /30
Below, each drill uses the same three steps against a real network so you can watch the arithmetic change while the method stays fixed.
/24 — 254 hosts Network 192.168.10.0/24 h = 32 − 24 = 8 host bits Addresses = 2^8 = 256 Usable = 256 − 2 = 254 Network .0 | first .1 | last .254 | broadcast .255 Count check: 254 − 1 + 1 = 254 OK /25 — 126 hosts Network 192.168.10.0/25 h = 32 − 25 = 7 host bits Addresses = 2^7 = 128 Usable = 128 − 2 = 126 Network .0 | first .1 | last .126 | broadcast .127 Count check: 126 − 1 + 1 = 126 OK /26 — 62 hosts Network 192.168.10.0/26 h = 32 − 26 = 6 host bits Addresses = 2^6 = 64 Usable = 64 − 2 = 62 Network .0 | first .1 | last .62 | broadcast .63 Count check: 62 − 1 + 1 = 62 OK /27 — 30 hosts Network 192.168.10.0/27 h = 32 − 27 = 5 host bits Addresses = 2^5 = 32 Usable = 32 − 2 = 30 Network .0 | first .1 | last .30 | broadcast .31 Count check: 30 − 1 + 1 = 30 OK /28 — 14 hosts Network 192.168.10.0/28 h = 32 − 28 = 4 host bits Addresses = 2^4 = 16 Usable = 16 − 2 = 14 Network .0 | first .1 | last .14 | broadcast .15 Count check: 14 − 1 + 1 = 14 OK /29 — 6 hosts Network 192.168.10.0/29 h = 32 − 29 = 3 host bits Addresses = 2^3 = 8 Usable = 8 − 2 = 6 Network .0 | first .1 | last .6 | broadcast .7 Count check: 6 − 1 + 1 = 6 OK /30 — 2 hosts Network 192.168.10.0/30 h = 32 − 30 = 2 host bits Addresses = 2^2 = 4 Usable = 4 − 2 = 2 Network .0 | first .1 | last .2 | broadcast .3 Count check: 2 − 1 + 1 = 2 OK
The full lookup table
This table is worth committing to memory. It is the single most reused set of numbers in the CCNA.
Notice the pattern: as the prefix increases by one, the total address count halves and the usable count is always two less than that total. There is no prefix between /24 and /30 whose usable count is not in this table — so for any host-count question inside a /24, the answer is one of 254, 126, 62, 30, 14, 6, 2.
Why /30 for router links
A link between two routers has exactly two devices that need addresses — one at each end. The smallest subnet that still follows the network/broadcast convention and yields two usable addresses is a /30: 22 − 2 = 2. That is a perfect fit, so /30 became the traditional point-to-point mask.
Point-to-point link 10.0.0.0/30 h = 32 − 30 = 2 host bits Addresses = 2^2 = 4 Usable = 2 Network 10.0.0.0 (reserved) Router A 10.0.0.1 (usable - often the .1 end) Router B 10.0.0.2 (usable - often the .2 end) Broadcast 10.0.0.3 (reserved) Check: 2 usable = Router A + Router B OK
You will see /30 links in routing labs, on serial interfaces, and in OSPF or EIGRP neighbour statements for the rest of the course. It is wasteful by exactly nothing for a two-device link: a /29 would give six using two and wasting four, which is why /30 is the disciplined choice.
The special cases: /31 and /32
Two prefixes break the “minus 2” rule. The exam treats them as special and you must label them as such.
- /31 (RFC 3021). A /31 has only
32 − 31 = 1host bit, so just 2 addresses. The classic formula would give2 − 2 = 0usable hosts, but RFC 3021 redefines a /31 so that both addresses are usable on a point-to-point link — there is no network or broadcast reserved. It is a modern, efficient point-to-point mask. However, it is not valid as a normal host subnet and is widely unsupported on older equipment, so for a standard host-count question treat /31 as “special / point-to-point only”. - /32. A /32 has
0host bits — a mask of all 1s. It identifies a single address, not a subnet. You will meet /32 as a host route (a route to one exact IP) and as a loopback interface address on a router.
Key terms & sources
Host bits
The bits not covered by the prefix: 32 − prefix.
Usable hosts
2h − 2, after removing the network and broadcast addresses.
Point-to-point link
A link with exactly two devices, one at each end (usually a /30 or /31).
/30
The classic router-to-router mask: 4 addresses, 2 usable.
/31
RFC 3021 point-to-point special case: 2 addresses, both usable.
/32
A single address (host route or loopback), 0 host bits.
- Pummill, R. & Manning, B. RFC 1878: Variable Length Subnet Table For IPv4 (1995) (usable-host table for every mask). rfc-editor.org/rfc/rfc1878.
- Rekhter, Y. et al. RFC 3021: Using 31-Bit Prefixes on IPv4 Point-to-Point Links (2000). rfc-editor.org/rfc/rfc3021.
- Fuller, V. & Li, T. RFC 4632: Classless Inter-Domain Routing (CIDR) (2006). rfc-editor.org/rfc/rfc4632.
- Cisco. CCNA (200-301) Exam Topics, IPv4 Addressing and Subnetting. cisco.com.
Review
Check what you have learned with these review questions.
Target exams: CCNA 200-301 v1.1 · CyberOps Associate 200-201. Last content verification: 2026-10-11.