[[cisco:config:wildcard-netmask]]
 

Cisco Systems - Wildcard Netmask in a Nutshell

A hit on a topic that eludes many people throughout their networking career! (Kind of like the nuances of subnetting.) But in reality, it's not difficult at all! Remember that routers are just dumb binary devices. Life revolves around zeroes and ones!

Wildcard masks are also referred to as „reverse“ netmasks. And quite simply that means wherever there's a 1 in a regular netmask, you'll use a 0 in a wildcard mask (used for ACLs too).


Normal Netmask

So, if my netmask normally is 255.255.255.0, in binary that is:

11111111 11111111 11111111 00000000 

Swapping the bits that yields:

00000000 00000000 00000000 11111111 
or 0.0.0.255 

ANY Netmask

Now, you can do this with ANY netmask you have. So in your example, you gave a /30, which normally is 255.255.255.252 or 30 1-bits:

11111111 11111111 11111111 11111100 

Swapping:

00000000 00000000 00000000 0000011 
or 0.0.0.3 


The easy way

Now, do you want the REALLY easy way? I thought you would…

Take your normal netmask and subtract each octet from 255. Yup, it's that simple, still dealing in „normal“ numbers!

255 255 255 255 - 255 255 255 0 = 0 0 0 255 (my "reverse" netmask) 

or

255 255 255 255 - 255 255 255 252 = 0 0 0 3 

See how simple that is? So, for OSPF networks, access- lists, or anything that calls for a wildcard mask… Now you know the magic behind it!

It's something that scares many people, but not really for any good reason. Broken down to the simplistic binary, we can see the mathematical relationships and understand how to use them more simply.

cisco/config/wildcard-netmask.txt · Zuletzt geändert: 12.09.2009 12:46 (Externe Bearbeitung)
 
Recent changes RSS feed Creative Commons License Donate Powered by PHP Valid XHTML 1.0 Valid CSS Driven by DokuWiki No Bad-Bot!
Guestbook