Welcome
First of all, may I welcome you to my site. My name is Chris and I'm from the UK and work as a Systems Engineer for Cisco. This blog was initially created to post up my subnetting technique but has now got more stuff to do with attaining Cisco certifications. Either way I really hope that the content is sufficent for your needs and I look forward to hearing your feedback. If you find that the content really helps you please feel free to donate using the PayPal link on the right.
To view the index of all my articles please click here.
Complex Route Summarization
Thursday, 17 April 2008
I've already posted about route summarization but I found this interesting technique for calculating complex route summaries at http://www.sadikhov.com/forum from member MarkinManchester. Thanks Mark!
Sometimes you are asked to filter a complex set of routes using as few lines as possible. Here we will examine a way to calculate the subnet and wildcard for such a scenario. With some practice, you should be able to calculate any set in 5 minutes or less. It is also recommend to test your results in a lab setting, using loopbacks and distribute-lists.
For example, say we are asked to filter the following routes using a one-line filter:
102.17.63.0
126.22.61.0
111.22.57.0
125.33.101.0
First, make a table as shown:
Then, enter the decimal digits from the first octet in the left-hand column. Convert each number to binary. You can use Windows Calculator set to Scientific Mode to do the conversion if you so wish.
In the binary area, first check the octet then column by column, apply the following rules:
- If the entire octet is 0, the subnet is 0 for that octet, and the mask is 255 for that octet.
- Else If the column is all 0’s, the subnet is 0, and the mask is 0
- Else If the column is all 1’s, the subnet is 1, and the mask is 0
- Else the column is a mixture of 1’s and 0’s, the subnet is 0, and the mask is 1.
For the first octet the table should look like:

Convert the binary Subnet and Wildcard Mask to decimal to complete the table:

So far, our filter looks like: 100.xxx.xxx.xxx 27.xxx.xxx.xxx
For the second octet the completed table should look like:

Our summary address now looks like: 100.0.xxx.xxx 27.55.xxx.xxx
For the third octet the completed table should look like:

Our summary address now looks like: 100.0.33.xxx 27.55.94.xxx
Now the last octet for all addresses is zero so the subnet address must be 0 in the last octet and the wilcard mask must be 255 in the last octet.
Our completed summary address looks like: 100.0.33.0 27.55.94.255
Apply this technique as you wish, for example:
access-list 1 permit 100.0.33.0 27.55.94.255
This is a great technique for reducing something complex into easier computation so hats off to Mark again for turning me on to this.
Posted byChris Bloomfield at 19:47 5 comments
Labels: complex, Route Summarization, Summarisation, summary routes, Supernetting, wildcard
How to calculate the Wildcard Mask
Wednesday, 12 December 2007
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
HTH,
Chris
Posted byChris Bloomfield at 11:36 25 comments
Labels: block, mask, size, Subnet, Subnetting, wildcard