Summarizing Routes in OSPF

Problem

You want to reduce the size of your routing tables without losing any connectivity within your network.

Solution

Using the area x range configuration command on your ABRs allows you summarize routes between OSPF areas:

Router1#configure terminal
Enter configuration commands, one per line.  End with CNTL/Z.
Router1(config)#router ospf 55
Router1(config-router)#area 100 range 172.20.0.0 255.255.0.0
Router1(config-router)#area 0 range 172.25.0.0 255.255.0.0
Router1(config-router)#area 2 range 10.0.0.0 255.0.0.0
Router1(config-router)#exit
Router1(config)#end
Router1#

Discussion

The easiest way to see the effect of summarization is to look at the routing table before and after it is enabled. Here is a sample routing table before summarization. The ranges that we will be summarizing are 172.20.0.0/16 and 172.25.0.0/16. We have highlighted the route with the lowest metric in each of these ranges:

Router2#show ip route ospf 172.16.0.0/24 is subnetted, 1 subnets O IA 172.16.2.0 [110/140] via 10.1.1.2, 00:05:06, Serial0/0 172.20.0.0/16 is variably subnetted, 3 subnets, 3 masks O IA 172.20.10.0/24 [110/1702] via 10.1.1.2, 00:05:06, Serial0/0 O IA 172.20.1.0/30 [110/1692] via 10.1.1.2, 00:05:06, Serial0/0 O IA 172.20.100.1/32 [110/1693] via 10.1.1.2, 00:05:06, Serial0/0 172.25.0.0/16 is variably subnetted, 3 subnets, 2 masks O IA 172.25.25.6/32 [110/141] via 10.1.1.2, 00:05:06, Serial0/0 O IA 172.25.25.1/32 [110/131] via 10.1.1.2, 00:05:06, Serial0/0 O IA 172.25.1.0/24 ...

Get Cisco IOS Cookbook, 2nd Edition now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.