Lesson 3 — Wildcard Masks
Wildcard Masks
Turn a subnet mask into its wildcard inverse and read what an address plus wildcard actually matches — the notation access lists and OSPF reuse later in the course.
Lesson orientation
What you'll learn (4 objectives)~14 min: video → lesson → check → apply → lab prep
Learning objectives
- Compute a wildcard mask as the inverse of a subnet mask by subtracting each octet from 255
- Interpret which address bits a wildcard requires to match and which it ignores
- Write the wildcard that matches an entire subnet, a single host, and any address
- Explain why access lists and OSPF network statements take wildcards rather than subnet masks
Terms you will see
Time breakdown
- Read the notes9 min
- Worked conversions and prediction5 min
A wildcard is the mask inverted
A subnet mask uses 1 bits to mark the network portion. A wildcard mask does the opposite: 0 bits mark the part of the address that must match, and 1 bits mark the part to ignore. Numerically it is the mirror image, so you compute it by subtracting each mask octet from 255.
| Prefix | Subnet mask | Wildcard | What it matches |
|---|---|---|---|
| /24 | 255.255.255.0 | 0.0.0.255 | one /24 — 256 addresses |
| /25 | 255.255.255.128 | 0.0.0.127 | one /25 — 128 addresses |
| /26 | 255.255.255.192 | 0.0.0.63 | one /26 — 64 addresses |
| /27 | 255.255.255.224 | 0.0.0.31 | one /27 — 32 addresses |
| /28 | 255.255.255.240 | 0.0.0.15 | one /28 — 16 addresses |
| /30 | 255.255.255.252 | 0.0.0.3 | one /30 — 4 addresses |
| /32 | 255.255.255.255 | 0.0.0.0 | exactly one host |
| /0 | 0.0.0.0 | 255.255.255.255 | every address |
Reading what an address and wildcard match
Pair an address with a wildcard and evaluate it bit by bit. A 0 in the wildcard means this bit of the address must match. A 1 means don't care. So 192.168.1.0 with wildcard 0.0.0.63 requires the first three octets and the top two bits of the fourth to match, while the low six bits are ignored — which is every address from 192.168.1.0 through 192.168.1.63, exactly the /26 subnet.
The same works when the boundary is further left. A /20 has mask 255.255.240.0, so its wildcard is 0.0.15.255 — the third octet may vary across 16 values and the fourth across all 256. Applied to 10.55.16.0, that matches 10.55.16.0 through 10.55.31.255, which is the /20 range computed in the previous lesson.
The two shortcuts you will use constantly
- A wildcard of 0.0.0.0 forces every bit to match, so it identifies a single host. Cisco lets you write host 10.1.1.1 instead, and the two forms are equivalent.
- A wildcard of 255.255.255.255 ignores every bit, so it matches anything. Cisco lets you write any, and again the two forms are equivalent.
Access lists and OSPF network statements take wildcards rather than subnet masks, which is the entire reason this lesson sits here rather than in the week those topics appear. When you reach Week 5 and write your first access list, the notation will already be familiar and the only new material will be the filtering logic.
What you should retain
- Wildcard = 255 − each subnet mask octet, the bit-inverse of the mask.
- In a wildcard, 0 means must match and 1 means ignore — the opposite of a subnet mask.
- A subnet's wildcard is its block size minus one, so /26 gives 0.0.0.63.
- 0.0.0.0 matches exactly one host; 255.255.255.255 matches any address.
- Access lists and OSPF consume wildcards, so this notation returns in Weeks 5 and 7.
Before you read on
Write the wildcard mask for a /27 subnet, and say what address range 172.16.8.64 with that wildcard matches.
Study deeper
Topic guides extend this lesson — they do not replace the first-party walkthrough above.
IP Addressing & Subnetting
For the wider CIDR and mask reference — useful if you want more mask-to-wildcard pairs than the table above
