Guide
IPv4 network, broadcast, first and last host addresses
Distinguish IPv4 subnet boundaries and calculate network, broadcast, and host range with a worked /27 example.
by Tools in a Tab · Published on · Reviewed on
Short answer
A conventional IPv4 subnet has boundaries calculated from its prefix. The network address sets every host bit to zero; the broadcast sets every host bit to one. The addresses between them form the range.
Example: 192.168.1.42/27
A /27 contains blocks of 32 addresses. In the final octet they begin at 0,
32, 64, 96, and so on. The value 42 falls inside the 32–63 block.
| Role | Address |
|---|---|
| Network | 192.168.1.32 |
| First conventional host | 192.168.1.33 |
| Last conventional host | 192.168.1.62 |
| Directed broadcast | 192.168.1.63 |
Verify the result with the IPv4 subnet calculator.
What each address means
- Network: identifies the entire prefix, not a conventional endpoint.
- Broadcast: targets hosts in the subnet where directed broadcasts are supported and permitted.
- First and last host: traditional boundaries after reserving network and broadcast.
Do not confuse “last address” with “last host.” They differ in conventional
subnets and behave specially elsewhere. On an RFC 3021 point-to-point /31,
both addresses can be endpoints; a /32 has one address only.
Binary method
The network is a bitwise AND of the IP and mask. The broadcast activates the bits selected by the wildcard:
IP 11000000.10101000.00000001.00101010
mask 11111111.11111111.11111111.11100000
network 11000000.10101000.00000001.00100000
The network ends in 00100000, decimal 32; the broadcast ends in
00111111, decimal 63.
Operational check
Before configuring an interface, confirm the IP, prefix, gateway, and local reservations. Mathematical membership does not prove that an address is free, that it is the correct gateway, or that connectivity exists.