Wildcard masks trip up almost everyone at first because they feel backwards compared to subnet masks. Once you see the rule, it's easy.

The one rule

In a wildcard mask, each bit means:

  • 0 = must match (check this bit)
  • 1 = don't care (ignore this bit)

That's the exact opposite of a subnet mask, where 1s are the network and 0s are the host. So a wildcard mask is just the inverse of a subnet mask.

The shortcut: 255 minus the subnet mask

To turn a subnet mask into a wildcard, subtract each octet from 255:

Subnet mask:   255.255.255.0
255 - each:    0.  0.  0.255
Wildcard:      0.0.0.255   (matches any host in a /24)

Subnet mask:   255.255.255.192   (/26)
Wildcard:      0.0.0.63

The two you must memorize

0.0.0.0 = match one exact host. Cisco lets you write host 10.1.1.1 instead.
255.255.255.255 = match anything. Cisco lets you write any.

Where you'll use it

Two big places on the CCNA: ACLs (which traffic a rule matches) and OSPF network statements (which interfaces join the process). Example ACL line:

access-list 10 permit 192.168.1.0 0.0.0.255

That permits every host in 192.168.1.0/24. Get the wildcard wrong and you'll match too much or too little — the most common ACL mistake there is.