Menu
Coddy logo textTech

Right-Sizing

Lesson 33 of 46 in Coddy's IP Addressing and Subnetting course.

Network design starts with one question per team: what is the smallest subnet that fits N machines? Find the smallest number of host bits where 2h - 2 is at least N, then the prefix is 32 - h.

For 50 hosts: 5 bits give 30 (too small), 6 bits give 62 (fits), so a /26. For 200 hosts: 7 bits give 126, 8 give 254, so a /24.

Always leave the minus two in the math. Forgetting it is how someone orders a /26 for exactly 63 machines and discovers the last one has no address.

challenge icon

Challenge

Easy

Print the smallest prefix (with slash) that fits each requirement, one per line, in this order:

  1. 50 hosts
  2. 200 hosts
  3. 2 hosts

Expected output:

/26
/24
/30

Try it yourself

Terminal

All lessons in IP Addressing and Subnetting

Practice on your own: Terminal playground