taap.digitalnetwork engineering toolkit

What is the wildcard mask for a /27?

Answer
0.0.0.31 wildcard for /27 (255.255.255.224)

A /27 has the subnet mask 255.255.255.224. Subtract it from 255.255.255.255 and you get the wildcard 0.0.0.31: the last 5 bits are "don't care", so it matches 32 consecutive addresses.

wildcard · adjust the values

The calculation

255.255.255.255 − 255.255.255.224 = 0.0.0.31

A /27 block is typically a 30-host segment such as a management or printer VLAN. With the network 10.0.0.0, the wildcard 0.0.0.31 matches 10.0.0.0 through 10.0.0.31.

Using it in Cisco IOS

! standard ACL
access-list 10 permit 10.0.0.0 0.0.0.31

! named extended ACL
ip access-list extended FROM-SITE
 permit ip 10.0.0.0 0.0.0.31 any

! OSPF
router ospf 1
 network 10.0.0.0 0.0.0.31 area 0

Junos, Arista EOS, MikroTik and Linux use the prefix form instead: 10.0.0.0/27.

Nearby prefixes

PrefixSubnet maskWildcardAddresses
/25255.255.255.1280.0.0.127128
/26255.255.255.1920.0.0.6364
/27255.255.255.2240.0.0.3132
/28255.255.255.2400.0.0.1516
/29255.255.255.2480.0.0.78

More questions like this

Frequently asked questions

How many addresses does 0.0.0.31 match?

32. The wildcard has 5 one-bits, and 25 = 32.

Is 0.0.0.31 the same as 255.255.255.224?

No. 255.255.255.224 is the subnet mask; 0.0.0.31 is its bitwise inverse. Putting the subnet mask where IOS expects a wildcard matches the wrong addresses.