If you need to enter a static route to several subnetted networks, you can use network summarization to reference them all in one route. Just the same, you need to understand how to read routes received from other providers. You must also know how to create an access list that references these multiple networks in a single summarized statement.
In this tip, you'll learn more about the IP addressing-related topics of network summarization, supernetting and wildcard masks.
Introduction to network summarization terminology
The term "route aggregation" is just another way of saying "network summarization." Supernetting, on the other hand, is the process of taking multiple networks and making a single larger network (very similar to summarization and aggregation). But what, specifically, are summarization and aggregation?
Network summarization is the act of taking two or more IP networks and using a single IP network to represent them all. This is possible because of classless inter-domain routing (CIDR). CIDR eliminates the need for a fixed-length subnet mask (FLSM) associated with our IP networks. This goes back to the old standard of having to have a certain subnet mask for classes of IP networks. Because everyone uses CIDR today, we can use variable-length subnet masks (VLSMs). This means we have the luxury of adding or subtracting bits from our subnet mask to allow us to either subnet our network further (by adding bits) or supernet our network (by taking bits away). Let's find out more.
What is network summarization (aka route aggregation)?
Say that I have IP networks 18.104.22.168 /24, 22.214.171.124 /24 and 126.96.36.199 /24. All of these networks have the subnet mask of 255.255.255.0 (hence, the /24). (See Binary-to-decimal conversion for more information on how this is calculated.) This means that if I take away bits from the subnet mask, I can encompass both of these networks with a single IP network and subnet mask. For example, I could say that these networks are represented by the IP address 188.8.131.52 with the subnet mask 255.255.0.0. With that statement, I have summarized or aggregated the three networks and am now representing them with a single IP address and subnet.
This can, of course, be done on a network calculator, but it is not hard to do by hand either. Here is an example:
Third octet of each IP and subnet mask
000000 01 = 1
000000 10 = 2
000000 11 = 3
111111 00 = 252
Using network summarization on a router
No matter the name that you give it, you need to know how to use network summarization/aggregation on a router. To do this, you will represent the IP networks with a single IP address and either a subnet mask or a wildcard mask.
Here is an example of using a subnet mask to summarize the same three networks in OSPF:
Router(config)# router ospf 1
Router(config-router)# area 1 range 184.108.40.206 255.255.252.0
As you can see, I just made an entry to summarize all three networks using the "range" command. The range command is used to summarize other OSPF networks. The same example can be applied to summarizing networks received from a different router protocol like Routing Information Protocol (RIP). Here's an example with the "summary-address" command:
Router(config-router)# summary-address 220.127.116.11 255.255.252.0
In both these cases, we have summarized or aggregated the network.
What are wildcard masks?
Wildcard masks are just another way to represent a subnet mask. Don't let how they look scare you off. You can easily convert a subnet mask into a wildcard mask. A wildcard mask is simply all the 1s in a subnet mask (when in binary form) turned into 0s, and all the 0s turned into 1s.
Here's an example:
Say that I have the same subnet mask as above, 255.255.252.0. This subnet mask in binary is:
11111111 11111111 11111100 00000000
To convert this to a wildcard mask, I simply turn all 1s into 0s and all 0s into 1s, then convert back to decimal.
Here's the conversion to a wildcard in binary:
00000000 00000000 00000011 11111111
Then, here's the conversion of that same wildcard in binary to decimal:
Wildcard masks are used in access lists. So, say that I wanted to permit the same three networks we listed above and deny all others. Here is an example of an access control list (ACL) that would do that, using a wildcard mask:
Router(config)# access-list 1 permit 18.104.22.168 ? A.B.C.D Wildcard bits log Log matches against this entryWith this ACL, all three of our networks (22.214.171.124, 126.96.36.199 and 188.8.131.52) are permitted and all other networks are denied.
Router(config)# access-list 1 permit 184.108.40.206 0.0.3.255 Router(config)# access-list 1 deny any
Here is what we have learned:
- An introduction to network summarization terminology, including network summarization, route aggregation, supernetting, CIDR and VLSM.
- How to use network summarization on a router with the OSPF routing protocol (in two different ways).
- What wildcard masks are, and how to use them in a Cisco IOS access list.
For help calculating IP address summarizations, see the online CIDR/VLSM supernetting calculator.
About the author:
David Davis (CCIE #9369, CWNA, MCSE, CISSP, Linux+, CEH) has been in the IT industry for 15 years. Currently, he manages a group of systems/network administrators for a privately owned retail company and authors IT-related material in his spare time. He has written more than 50 articles, eight practice tests and three video courses and has co-authored one book. His Web site is HappyRouter.com.
Thanks to Gary Fairclough for checking our math! - Editor
This was first published in March 2007