OSPF route summarization shrinks routing tables and contains the blast radius of topology changes, but you can only do it in two places: at an ABR (between areas) or at an ASBR (for redistributed routes). That restriction is not arbitrary. Within a single area, every router must hold an identical link-state database, so no router inside an area is allowed to hide or aggregate anything. Only at area and domain boundaries, where routes are already re-advertised as summaries, does OSPF get the freedom to aggregate. The full OSPF guide covers where these boundaries sit in the overall design.
This article configures both flavors and verifies the interesting side effects, using output from a Cisco Modeling Labs topology on IOS XE 17.18. In the lab: R1 and R2 share a LAN in area 0, R2-R3 is a /30 in area 1, and R3 carries four loopbacks (172.16.0.1 through 172.16.3.1, each /24) in area 1, advertised with their real masks via the point-to-point network type. R2, sitting between area 0 and area 1, is the ABR where the summarization happens.
Inter-area summarization at the ABR
Without summarization, each of R3's four loopback networks travels through R2 as its own type 3 summary LSA and lands in R1's routing table as its own inter-area route:
R1# show ip route ospf | begin 172.16
172.16.0.0/24 is subnetted, 4 subnets
O IA 172.16.0.0 [110/21] via 10.0.12.2, 00:00:16, Ethernet0/0
O IA 172.16.1.0 [110/21] via 10.0.12.2, 00:00:16, Ethernet0/0
O IA 172.16.2.0 [110/21] via 10.0.12.2, 00:00:15, Ethernet0/0
O IA 172.16.3.0 [110/21] via 10.0.12.2, 00:00:15, Ethernet0/0Four /24s fit neatly into one /22 (172.16.0.0 through 172.16.3.255), so the ABR can advertise a single summary instead. The command is area range, configured on the ABR under the OSPF process, and the area you name is the one the routes come from:
R2(config)# router ospf 1
R2(config-router)# area 1 range 172.16.0.0 255.255.252.0After that one command, R1's table collapses to a single route:
R1# show ip route ospf | begin 172.16
172.16.0.0/22 is subnetted, 1 subnets
O IA 172.16.0.0 [110/21] via 10.0.12.2, 00:00:16, Ethernet0/0Beyond the smaller table, the real win is stability: if one of R3's loopbacks flaps, the ABR's /22 stays up as long as at least one component route exists, so routers in area 0 never see the change and never rerun SPF for it. Summarization is a fault-isolation tool as much as a table-size tool (how areas already isolate flooding is covered in OSPF areas explained).
The discard route: why the ABR routes to Null0
Summarization quietly adds something to the ABR's own routing table:
R2# show ip route ospf | include Null0
O 172.16.0.0/22 is a summary, 00:00:24, Null0This is the discard route, and it exists to prevent routing loops. R2 is advertising "I can reach all of 172.16.0.0/22", but it only has real routes for the four /24s inside it. If a packet arrives for an address in the /22 that has no matching more-specific route (say 172.16.2.77 while 172.16.2.0/24 is down), R2 would otherwise fall back to a default route, which might point right back toward the router that sent the packet, and the packet would ping-pong until its TTL expired. The Null0 route catches that traffic and drops it on the ABR. Longest-prefix matching means legitimate traffic always hits the more specific /24 routes first, so the discard route only ever eats packets that had nowhere real to go. Do not "clean it up"; it is supposed to be there.
What the summary LSA looks like
In the LSDB, the summary is an ordinary type 3 summary LSA, just with an aggregated mask. You can inspect it directly on the ABR:
R2# show ip ospf database summary 172.16.0.0 | include Link|Network|mask
Summary Net Link States (Area 0)
LS Type: Summary Links(Network)
Link State ID: 172.16.0.0 (summary Network Number)
Network Mask: /22Note the area: the LSA is flooded into area 0, because that is where the aggregated reachability is being advertised. The four component /24 LSAs no longer appear in area 0 at all; inside area 1, nothing changes and every router still sees the individual networks. (For the full taxonomy of what each LSA type carries, see OSPF LSA types explained.)
External summarization at the ASBR
The area range command only aggregates inter-area (type 3) routes. Redistributed routes enter OSPF as type 5 external LSAs, and those are summarized with a different command, on the ASBR that originates them:
R3(config)# router ospf 1
R3(config-router)# summary-address 10.99.0.0 255.255.0.0With that in place, an ASBR redistributing many external prefixes (statics, BGP, another IGP) originates a single type 5 LSA for the summary instead of one per prefix, and it installs the same style of Null0 discard route locally. The two commands are easy to confuse, so anchor them to roles: area range on the ABR for internal routes crossing areas, summary-address on the ASBR for external routes entering the domain. If redistribution itself is the part you are setting up, the companion article on OSPF redistribution configuration covers it end to end.
Design notes
Summarization is only as good as your addressing plan. The lab's four consecutive /24s collapsed into a clean /22 because they were allocated contiguously; four scattered /24s would have forced either four separate ranges (no gain) or an oversized summary that claims address space the area does not own. Oversized summaries are the sharper edge: if your range covers prefixes that live elsewhere in the network, the ABR will attract traffic for them and the discard route will drop it. Keep summaries as tight as the addressing allows, allocate per-area blocks up front, and summarization becomes a one-line command per area instead of a migration project.
Key Takeaways
- OSPF can only summarize at boundaries:
area rangeon the ABR for inter-area routes,summary-addresson the ASBR for redistributed externals. Inside an area the LSDB must stay identical, so nothing can be hidden. - One
area 1 range 172.16.0.0 255.255.252.0on the ABR turned four O IA /24s on R1 into a single /22, and it also suppresses SPF churn in area 0 when a component route flaps. - The automatic Null0 discard route on the summarizing router is loop prevention, not clutter; it drops traffic for unreachable space inside the summary.
- The summary is a normal type 3 LSA with an aggregated mask, flooded into the receiving area.
- Contiguous per-area address allocation is what makes any of this possible; plan addressing with summarization in mind.