Reference

Subnet mask cheat sheet.

Mask, wildcard, block size and host count for every prefix from /8 to /32. Then practise it in the free drill.

Every prefix, /8 to /32

The shaded rows, /24 to /30, cover almost every exam question.

PrefixSubnet maskWildcardBlock sizeAddressesUsable hosts
/8255.0.0.00.255.255.255256 2nd octet16,777,21616,777,214
/9255.128.0.00.127.255.255128 2nd octet8,388,6088,388,606
/10255.192.0.00.63.255.25564 2nd octet4,194,3044,194,302
/11255.224.0.00.31.255.25532 2nd octet2,097,1522,097,150
/12255.240.0.00.15.255.25516 2nd octet1,048,5761,048,574
/13255.248.0.00.7.255.2558 2nd octet524,288524,286
/14255.252.0.00.3.255.2554 2nd octet262,144262,142
/15255.254.0.00.1.255.2552 2nd octet131,072131,070
/16255.255.0.00.0.255.255256 3rd octet65,53665,534
/17255.255.128.00.0.127.255128 3rd octet32,76832,766
/18255.255.192.00.0.63.25564 3rd octet16,38416,382
/19255.255.224.00.0.31.25532 3rd octet8,1928,190
/20255.255.240.00.0.15.25516 3rd octet4,0964,094
/21255.255.248.00.0.7.2558 3rd octet2,0482,046
/22255.255.252.00.0.3.2554 3rd octet1,0241,022
/23255.255.254.00.0.1.2552 3rd octet512510
/24255.255.255.00.0.0.255256 4th octet256254
/25255.255.255.1280.0.0.127128 4th octet128126
/26255.255.255.1920.0.0.6364 4th octet6462
/27255.255.255.2240.0.0.3132 4th octet3230
/28255.255.255.2400.0.0.1516 4th octet1614
/29255.255.255.2480.0.0.78 4th octet86
/30255.255.255.2520.0.0.34 4th octet42
/31255.255.255.2540.0.0.12 4th octet22
/32255.255.255.2550.0.0.01 4th octet11

Where the columns come from

Three rules produce the whole table

  1. 01

    Block size

    256 minus the mask in the first octet that is not 255. A /26 mask ends in 192, so the block size is 64.

  2. 02

    Wildcard mask

    255 minus each octet of the mask. It is the mask turned inside out, which is how ACLs and OSPF network statements write it.

  3. 03

    Usable hosts

    2 to the power of the host bits, minus 2 for the network and broadcast addresses. A /26 has 6 host bits: 64 − 2 = 62.

Questions about the table

How to read it and why the numbers are what they are.

It is the step between one subnet and the next in the octet it names. A /26 has a block size of 64 in the fourth octet, so the subnets start at .0, .64, .128 and .192. A block of 256 means the whole octet: the next network starts one octet earlier.

The first address of a subnet is its network address and the last is its broadcast address, so neither can be given to a host. Two exceptions: a /31 has two usable addresses because it is used on point-to-point links (RFC 3021), and a /32 is a single host address.

The rows from /24 to /30 are highlighted in the table. They cover almost every subnetting question, because the hard part is the interesting octet, and from /24 to /30 that is always the fourth.

Every figure is computed from the prefix when the page is built, not typed in, so a typo cannot get into a row. Practise with it in the free drill, which grades the answer you work out.

Ready to see it work? Try a drill

Ready to pass the exam?Start drilling today

Practice that grades itself, so you always know why.

Try the first drill now. No sign-up needed.