Subnet masks and prefix length
Memorize the prefix-to-mask table and you have memorized half of subnetting. This chapter gives you the table, the trick to derive any mask from scratch, and the formulas for hosts-per-subnet and subnets-per-supernet.
Memorize the prefix-to-mask table and you have memorized half of subnetting. This chapter gives you the table, the trick to derive any mask from scratch, and the formulas for hosts-per-subnet and subnets-per-supernet.
/8 255.0.0.0 16,777,214 hosts
/16 255.255.0.0 65,534 hosts
/24 255.255.255.0 254 hosts ← classic LAN
/25 255.255.255.128 126 hosts
/26 255.255.255.192 62 hosts
/27 255.255.255.224 30 hosts
/28 255.255.255.240 14 hosts
/29 255.255.255.248 6 hosts
/30 255.255.255.252 2 hosts ← point-to-point
/31 255.255.255.254 2 hosts ← RFC 3021 PtP
/32 255.255.255.255 1 host ← loopback / routeIf h is the number of host bits, the subnet has 2^h total addresses. Two are reserved: the all-zeros address is the network identifier and the all-ones address is the broadcast. Everything in between is usable for hosts.
RFC 3021 added a special exception: a /31 has only two addresses, but on a strict point-to-point link they can both be used as host addresses. Most modern routers accept /31 today.
1 more section in this chapter, plus a 3-question quiz.
You can see the title, summary, learning objectives and the opening sections. The rest of this chapter, like all of modules 2–8, comes with the Course & Lab Pass and All-Access Max. A free account opens Module 1: Network Foundations end-to-end and saves your labs — start there, no card required.
NetForge-AI is an independent educational platform and is not affiliated with, endorsed by, or sponsored by any networking vendor or certification body. All product names, protocols, and standards referenced are the property of their respective owners and are used for descriptive, educational purposes only.
Free account · no card required · compare plans any time