Wildcard Mask Scenarios for ACLs
Wildcard masks and ACL syntax for “match a subnet”, “match one host”, “match odd addresses” and more.
| Goal | Mask | Wildcard | ACL syntax |
|---|---|---|---|
| Match one host | 255.255.255.255 | 0.0.0.0 | permit host 192.168.1.10 |
| Match an entire /24 | 255.255.255.0 | 0.0.0.255 | permit 192.168.1.0 0.0.0.255 |
| Match an entire /26 | 255.255.255.192 | 0.0.0.63 | permit 192.168.1.0 0.0.0.63 |
| Match two adjacent /24s (a /23) | 255.255.254.0 | 0.0.1.255 | permit 192.168.0.0 0.0.1.255 |
| Match any address | 0.0.0.0 | 255.255.255.255 | permit any |
| Match odd addresses in a subnet | — | 0.0.0.254 | permit 192.168.1.1 0.0.0.254 |
| Match even addresses in a subnet | — | 0.0.0.254 | permit 192.168.1.0 0.0.0.254 |
| Match a non-power-of-two contiguous range | — | Split into multiple lines, or use a prefix-list | No single-line equivalent |
No matching rows