Pesquisar neste blog

segunda-feira, 21 de julho de 2014

How to calculate the Wildcard Mask

This is really simple.

Simply subtract your mask from 255.255.255.255 to get your wildcard mask.

Example:

The wilcard mask of /26 is:

255.255.255.255 - 255.255.255.192 = 0.0.0.63

The wilcard mask of /19 is:

255.255.255.255 - 255.255.224.0 = 0.0.31.255

The wildcard mask of /12 is:

255.255.255.255 - 255.240.0.0 = 0.15.255.255

There is an alternative way of calculating your wildcard mask which follows on from the Subnetting Made Easy post about boundaries. If you do not understand what I mean about boundaries please read that post.

For example, if you had a /28, your next boundary is /32 so 32 - 28 = 4 and 24 = 16. If we subtract 1 from the block size it gives us 15 which is what we put into our wildcard mask in the octet that we are subnetting in. All octets before the one we are subnetting in are 0 and all octets after the octet we are subnetting in should be 255. 

Let's follow that again:

1. /28 gives us 15 in the last octet (i.e. 32 - 28 = 4 and 24 - 1 = 15)
2. All octets before that octet have to be 0 (i.e. 1st, 2nd, and 3rd octets)
3. All octets after that octet have to be 255 (not applicable here as /28 is in the last octet)
4. We therefore have 0.0.0.15 as our wildcard mask

Let's do it with a /21:

1. /21 gives us 7 in the third octet (i.e. 24 - 21 = 3 and 23 - 1 = 7)
2. All octets before that octet have to be 0 (i.e. 1st and 2nd octets)
3. All octets after that octet have to be 255 (i.e. the 4th octet)
4. We therefore have 0.0.7.255 as our wildcard mask

Let's do it with a /9:

1. /9 gives us 127 in the second octet (i.e. 16 - 9 = 7 and 27 - 1 = 127
2. All octets before that octet have to be 0 (i.e. the 1st octet)
3. All octets after that octet have to be 255 (i.e. the 3rd and 4th octet)
4. We therefore have 0.127.255.255 as our wildcard mask

Nenhum comentário: