How many usable host addresses H are there in an IPv4 subnet with prefix /26?
Find H
Show hints
- The host part has 32 − p bits.
- Subtract 2 for the network and broadcast addresses.
- 32 − 26 = 6.
Show the answer and the step-by-step solution
IPv4 subnetting: an address has 32 bits. The prefix /p says how many leading bits identify the network; the remaining 32 − p bits number the hosts. A subnet has 2³²⁻ᵖ addresses, but the first (network address) and last (broadcast address) cannot be given to hosts, so 2³²⁻ᵖ − 2 hosts fit. Exceptions: a /31 (point-to-point link, RFC 3021) uses both of its 2 addresses for hosts, and a /32 is one single address (a single host or a loopback).