How many usable hosts are in a /26, and why minus 2?
My practice question says a /26 has 62 hosts. I get 64 from 2^6. Where do the other two addresses go — and is that always the rule?
1 Answer
A /26 leaves 6 host bits → 2^6 = 64 total addresses, but two are reserved in every ordinary subnet: the all-zeros host part is the network address (it names the subnet itself) and the all-ones host part is the directed broadcast. That leaves 62 assignable. So the formula is 2^(host bits) − 2. Two exceptions worth knowing: /31 point-to-point links (RFC 3021) use both addresses — there's no broadcast on a two-device link — and /32 is a single host route. Exam shortcut: for "how many hosts fit," always subtract 2 first; picking 64 instead of 62 is the classic trap answer they include on purpose.