Options for 2 hosts
| Prefix | Mask | Usable hosts | Spare |
|---|---|---|---|
| /31 | 255.255.255.254 | 2 | 0 |
| /30 | 255.255.255.252 | 2 | 0 |
| /29 | 255.255.255.248 | 6 | 4 |
Rule: find the power of 2 that, minus 2, covers the host count. The exponent is the number of host bits and the prefix is 32 minus those bits.
Step by step
- With 2 hosts there is no need for network and broadcast addresses: a point-to-point link can use a /31 (RFC 3021), with 2 addresses.
- Prefix: 32 − 1 = /31 (255.255.255.254).
- If the device does not accept /31, use a /30: 4 addresses, 2 usable.
Other host counts
| Hosts | Prefix | Usable | Used |
|---|---|---|---|
| 2 | /31 | 2 | 100% |
| 6 | /29 | 6 | 100% |
| 10 | /28 | 14 | 71% |
| 14 | /28 | 14 | 100% |
| 20 | /27 | 30 | 67% |
| 30 | /27 | 30 | 100% |
| 50 | /26 | 62 | 81% |
| 60 | /26 | 62 | 97% |
| 100 | /25 | 126 | 79% |
| 120 | /25 | 126 | 95% |
| 200 | /24 | 254 | 79% |
| 250 | /24 | 254 | 98% |
| 500 | /23 | 510 | 98% |
| 1,000 | /22 | 1,022 | 98% |
| 2,000 | /21 | 2,046 | 98% |
| 4,000 | /20 | 4,094 | 98% |
In practice
If the link may gain more devices later, a /29 gives 6 usable hosts and, with 2 hosts, sits at 33% used.
To try other values, open the Hosts → mask calculator with these numbers already filled in.