Wildcard mask: the inverse of the subnet mask, how to calculate it, host and any
Sign in to read this lesson
An ACL uses a wildcard mask (wildcard bits), not a subnet mask. A wildcard mask is the inverse of the subnet mask: in binary every 1 bit becomes 0 and every 0 bit becomes 1. For example, 255.255.255.0 becomes 0.0.0.255, 255.255.255.128 becomes 0.0.0.127 and 255.255.255.224 becomes 0.0.0.31. Shortcut: subtract the subnet mask from 255.255.255.255. In a wildcard a 0 bit means "this bit must match" and a 1 bit means "this bit does not matter". There are two shortcuts: host is a single IP address (wildcard 0.0.0.0) and any is every IP address (0.0.0.0 255.255.255.255).
What you will learn
- An ACL uses a wildcard mask, not a subnet mask. A wildcard mask is the inverse of the subnet mask: every bit is flipped (1 → 0, 0 → 1).
- Examples: 255.255.255.0 → 0.0.0.255, 255.255.255.128 → 0.0.0.127, 255.255.255.224 → 0.0.0.31.
- Shortcut: 255.255.255.255 − subnet mask. For example, 255.255.255.255 − 255.255.255.224 = 0.0.0.31.
- In a wildcard, 0 bit = must match, 1 bit = does not matter. 172.16.1.0 0.0.0.255 → 172.16.1.0 – 172.16.1.255.
- Shortcuts:
host 172.16.2.1= 172.16.2.1 0.0.0.0 (one IP);any= 0.0.0.0 255.255.255.255 (every IP).
The lesson has 5 key points, an explanation and 5 questions. It opens with a package.