Lesson 2 of 7
Masks, Prefixes and Wildcards
The same boundary is written three ways: /26, 255.255.255.192 and, in an access list, 0.0.0.63. Here is how to move between them without a table.
Training is free for members. We are checking whether you are signed in; if you are not, we will take you to sign in and bring you straight back here. Nothing happening? Register or sign in with a code we email you.
The Prefix Is a Count of 1s
/26 means the first 26 of the 32 bits are network bits. Write 26 ones and 6 zeros, split
into octets, and convert each octet:
11111111.11111111.11111111.11000000 = 255.255.255.192
Shortcut: 26 is three full octets (24 bits) plus 2 more. Two network bits in an octet is 192 (from the table in lesson one), so the mask is 255.255.255.192.
Worked Example: /19
19 is two full octets (16 bits) plus 3. Three network bits in an octet is 224, and everything
after it is 0, so /19 is 255.255.224.0.
Wildcard Masks
Access lists on Cisco kit, and OSPF network statements, use a wildcard mask: the subnet mask with every bit flipped. In decimal, take each octet away from 255.
255.255.255.255 - 255.255.255.192 = 0.0.0.63, so /26 has the wildcard 0.0.0.63. For /19 it is 0.0.31.255.
The Ones You Will Meet Most
| Prefix | Mask | Wildcard |
|---|---|---|
| /8 |
255.0.0.0
|
0.255.255.255
|
| /16 |
255.255.0.0
|
0.0.255.255
|
| /19 |
255.255.224.0
|
0.0.31.255
|
| /22 |
255.255.252.0
|
0.0.3.255
|
| /24 |
255.255.255.0
|
0.0.0.255
|
| /26 |
255.255.255.192
|
0.0.0.63
|
| /27 |
255.255.255.224
|
0.0.0.31
|
| /28 |
255.255.255.240
|
0.0.0.15
|
| /29 |
255.255.255.248
|
0.0.0.7
|
| /30 |
255.255.255.252
|
0.0.0.3
|
Check any of these in the subnet calculator: it shows the mask, the wildcard and the mask in binary for whatever you type.
Practice
5 questions, new each time. Every answer is worked out by the same library as our subnet calculator, so if one looks wrong, check your working first and then tell us.