What is a summary (aggregate) static route, and what has to be true for one to work?
One static route whose shorter prefix covers several contiguous networks that all share the same next hop — so four /24 routes collapse into a single /22 line.
* Four contiguous /24s aggregate into one /22 entry. *
Instead of four separate entries pointing the same way:
ip route 172.16.0.0 255.255.255.0 10.0.0.2
ip route 172.16.1.0 255.255.255.0 10.0.0.2
ip route 172.16.2.0 255.255.255.0 10.0.0.2
ip route 172.16.3.0 255.255.255.0 10.0.0.2
you configure one summary route:
ip route 172.16.0.0 255.255.252.0 10.0.0.2 ! /22 covers .0 through .3
A /22 mask (255.255.252.0) frees the last two bits of the third octet, so it matches 172.16.0.0 through 172.16.3.255 — exactly those four subnets.
Two conditions must hold:
- The networks are contiguous and align on a power-of-two block boundary (here, four subnets starting at .0), so one shorter prefix covers them with no gaps.
- They share the same next hop / exit path — the summary sends the whole range one direction.
Why bother: fewer routing-table entries means less memory, faster lookups, and one line to maintain instead of four. The risk: if the summary also covers an address you can't actually reach that way, traffic to it is black-holed — so summarize only blocks that truly live behind that next hop.
Go deeper:
Supernetwork — route summarization / aggregation (Wikipedia) — the supernetting / prefix-aggregation concept a summary route applies, with worked CIDR examples.