skinsurf@subnet:~$

subnet-console▊

CCNA 200-301 · drill mode
▸ reference & method — open before you drill›

The magic-number method (do it in your head)

  1. Find the interesting octet — the one the prefix (/CIDR) lands in. /9–16 → 2nd octet, /17–24 → 3rd, /25–32 → 4th.
  2. Block size = 256 − mask value of that octet. Also = 2^(bits left in the octet). This is your "magic number."
  3. Count in blocks (0, block, 2×block…) until you pass the host's value. The one you didn't pass is the network address for that octet; octets before it stay the same, octets after go to 0.
  4. Broadcast = network + block size − 1 in the interesting octet; octets after become 255.
  5. First usable = network + 1. Last usable = broadcast − 1. Usable hosts = 2^(host bits) − 2.

Example — 172.16.68.5/22: /22 → interesting octet = 3rd. Mask 3rd octet = 252, block = 256−252 = 4. Count 0,4,…,64,68,72 → 68 doesn't pass 68, next block 72 does → network 172.16.68.0, broadcast 172.16.71.255, range .68.1–.71.254, usable = 2^10−2 = 1022.

Powers of 2 — memorize these cold

2ⁿ2481632641282565121024
n12345678910

Mask octet values & block sizes

/bits in octetmask valblock (256−mask)
1 → .128128128
2 → .19219264
3 → .22422432
4 → .24024016
5 → .2482488
6 → .2522524
7 → .2542542
8 → .2552551

CIDR → mask quick table

/CIDRMaskWildcardUsable hosts
/24255.255.255.00.0.0.255254
/25255.255.255.1280.0.0.127126
/26255.255.255.1920.0.0.6362
/27255.255.255.2240.0.0.3130
/28255.255.255.2400.0.0.1514
/29255.255.255.2480.0.0.76
/30255.255.255.2520.0.0.32

Formulas & facts

Wildcard = 255.255.255.255 − mask (the inverse). Usable hosts = 2^(32−CIDR) − 2. Subnets from a base = 2^(borrowed bits).

RFC1918 private: 10.0.0.0/8 · 172.16.0.0/12 · 192.168.0.0/16. /31 = 2 point-to-point hosts (RFC3021), /32 = single host.

0streak
0correct
0attempts
—accuracy
—last (s)
Enter check / next  ·  Tab move  ·  built for the /8–/30 range you'll see on the exam