Wildcard mask explained

A wildcard mask is a mask of bits that indicates which parts of an IP address are available for examination. In the Cisco IOS,[1] they are used in several places, for example:

A wildcard mask can be thought of as an inverted subnet mask. For example, a subnet mask of 255.255.255.0 inverts to a wildcard mask of 0.0.0.255 .

A wild card mask is a matching rule.[2] The rule for a wildcard mask is:

Any wildcard bit-pattern can be masked for examination. For example, a wildcard mask of 0.0.0.254 applied to IP address 10.10.10.2 will match even-numbered IP addresses 10.10.10.0, 10.10.10.2, 10.10.10.4, 10.10.10.6 etc. Same mask applied to 10.10.10.1 will match odd-numbered IP addresses 10.10.10.1, 10.10.10.3, 10.10.10.5 etc.

A network and wildcard mask combination of 1.1.1.1 0.0.0.0 would match an interface configured exactly with 1.1.1.1 only, and nothing else.

Wildcard masks are used in situations where subnet masks may not apply. For example, when two affected hosts fall in different subnets, the use of a wildcard mask will group them together.

List of wildcard masks
Slash Netmask Wildcard mask
/32 255.255.255.255 0.0.0.0
/31 255.255.255.254 0.0.0.1
/30 255.255.255.252 0.0.0.3
/29 255.255.255.248 0.0.0.7
/28 255.255.255.240 0.0.0.15
/27 255.255.255.224 0.0.0.31
/26 255.255.255.192 0.0.0.63
/25 255.255.255.128 0.0.0.127
/24 255.255.255.0 0.0.0.255
/23 255.255.254.0 0.0.1.255
/22 255.255.252.0 0.0.3.255
/21 255.255.248.0 0.0.7.255
/20 255.255.240.0 0.0.15.255
/19 255.255.224.0 0.0.31.255
/18 255.255.192.0 0.0.63.255
/17 255.255.128.0 0.0.127.255
/16 255.255.0.0 0.0.255.255
/15 255.254.0.0 0.1.255.255
/14 255.252.0.0 0.3.255.255
/13 255.248.0.0 0.7.255.255
/12 255.240.0.0 0.15.255.255
/11 255.224.0.0 0.31.255.255
/10 255.192.0.0 0.63.255.255
/9 255.128.0.0 0.127.255.255
/8 255.0.0.0 0.255.255.255
/7 254.0.0.0 1.255.255.255
/6 252.0.0.0 3.255.255.255
/5 248.0.0.0 7.255.255.255
/4 240.0.0.0 15.255.255.255
/3 224.0.0.0 31.255.255.255
/2 192.0.0.0 63.255.255.255
/1 128.0.0.0 127.255.255.255
/0 0.0.0.0 255.255.255.255

Notes and References

  1. http://www.cisco.com/en/US/docs/app_ntwk_services/waas/waas/v511/command/reference/ext_acl.pdf Cisco Wide Area Application Services Command Reference
  2. http://www.omnisecu.com/cisco-certified-network-associate-ccna/access-control-list-acl-wildcard-masks.php Matching Guide