taap.digitalnetwork engineering toolkit

What is the wildcard mask for a /30?

Answer
0.0.0.3 wildcard for /30 (255.255.255.252)

A /30 has the subnet mask 255.255.255.252. Subtract it from 255.255.255.255 and you get the wildcard 0.0.0.3: the last 2 bits are "don't care", so it matches 4 consecutive addresses.

wildcard · adjust the values

The calculation

255.255.255.255 − 255.255.255.252 = 0.0.0.3

A /30 block is typically a point-to-point link with two usable addresses. With the network 10.0.0.0, the wildcard 0.0.0.3 matches 10.0.0.0 through 10.0.0.3.

Using it in Cisco IOS

! standard ACL
access-list 10 permit 10.0.0.0 0.0.0.3

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

! OSPF
router ospf 1
 network 10.0.0.0 0.0.0.3 area 0

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

Nearby prefixes

PrefixSubnet maskWildcardAddresses
/28255.255.255.2400.0.0.1516
/29255.255.255.2480.0.0.78
/30255.255.255.2520.0.0.34

More questions like this

Frequently asked questions

How many addresses does 0.0.0.3 match?

4. The wildcard has 2 one-bits, and 22 = 4.

Is 0.0.0.3 the same as 255.255.255.252?

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