Author Topic: Wild card mask  (Read 4811 times)

admin

  • Administrator
  • Newbie
  • *****
  • Posts: 44
Wild card mask
« on: October 08, 2011, 07:06:33 AM »
You have 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).

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

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

0.0.0.3

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!

So:

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.

Hope that helps!