COMPUTER SCIENCE / NETWORKING

Route Summarization and CIDR Aggregation Calculator for IPv4 and IPv6

Turn overlapping or adjacent routes into the smallest exact CIDR list, compare it with one covering supernet and see exactly which extra addresses a broad summary would advertise.

Enter routes to aggregate

Examples

Enter one item per line, or separate simple entries with commas or semicolons. Accepted formats include CIDR, bare hosts, IPv4 subnet masks, explicit wildcard masks, address ranges and common pasted route lines. Analyse IPv4 and IPv6 separately.

Accepted input formats and examples
  • 10.24.0.0/24 or 2001:db8:1200::/48
  • 10.24.0.0 255.255.255.0 or 10.24.0.0/255.255.255.0
  • 10.24.0.0 wildcard 0.0.0.255
  • 10.24.0.0 - 10.24.3.255 or 2001:db8:: to 2001:db8::ffff
  • ip route 10.24.0.0 255.255.255.0 192.0.2.1
  • network 10.24.0.0 mask 255.255.255.0
  • 10.24.0.0/24 via 192.0.2.1 and similar route-table lines containing a CIDR
  • 192.0.2.10 or 2001:db8::10 (treated as a host route)

Lines beginning with # or //, and trailing comments after whitespace, are ignored.

If a device, cloud route table or BGP peer accepts only a certain number of routes, enter it here. The calculator finds the summary with that many routes or fewer that adds the least unused address space.

Exact aggregation versus one covering supernet

Exact CIDR aggregation removes duplicate and redundant routes and combines only blocks that align on a valid binary boundary. It does not change the represented address space. A single covering supernet is the shortest prefix containing every route, but it may also contain gaps that were never in the input. Advertising that summary can send traffic to the wrong router unless those additional networks are intentionally owned by the same site.

The input parser normalises host addresses, ranges, dotted IPv4 masks, wildcard masks and pasted route entries before aggregation. A range does not need to start or end on a CIDR boundary; the exact result divides it into the minimum aligned CIDRs.

Common route-summarization uses

Summarising branch routes

A hub may learn dozens of branch LANs and advertise a smaller set upstream. For example, four contiguous /24 networks from 10.40.0.0 through 10.40.3.255 aggregate exactly to 10.40.0.0/22.

Checking a proposed cloud route

Before replacing several VPC or VNet routes with a broad prefix, validate the proposal. The additional-CIDR result identifies address space that the summary would attract even though it is not part of the original set.

Cleaning firewall and BGP prefix lists

Duplicate, contained and adjacent prefixes make policies longer and harder to audit. Exact aggregation produces a canonical list while preserving the original coverage.

How to summarise routes by hand

Route summarization is easiest to see in binary. Take four networks: 10.24.0.0/24, 10.24.1.0/24, 10.24.2.0/24 and 10.24.3.0/24. Only the third octet differs, so write it in binary:

NetworkThird octet
10.24.0.0/24000000|00
10.24.1.0/24000000|01
10.24.2.0/24000000|10
10.24.3.0/24000000|11
  1. Count the leading bits that every network shares. Here it is the first 16 bits (10.24) plus the first 6 bits of the third octet, 22 bits in all.
  2. Keep those bits and set the rest to zero. That gives the summary address, 10.24.0.0.
  3. The number of shared bits is the prefix length, so the summary is 10.24.0.0/22.
  4. Check that the summary covers nothing extra. A /22 holds four /24s and you have all four, so this summary is exact.

Had 10.24.2.0/24 been missing, the shared bits would be the same, but the /22 would also cover a network you don’t have. The calculator shows that as extra address space, and the exact aggregation would be 10.24.0.0/23 plus 10.24.3.0/24 instead. The binary table in the results draws this for your own routes.

Fitting a route limit

Many devices and services cap how many routes they accept. An AWS virtual private gateway accepts at most 100 dynamic routes from your side of a Site-to-Site VPN, and that quota can’t be raised. Small routers and firewalls have their own limits, and BGP peers often enforce a maximum-prefix setting that drops the session when it is exceeded.

When the exact aggregation is still longer than the limit, some extra address space has to be advertised. Enter the limit and the calculator searches every way of covering your routes with that many prefixes or fewer, then picks the one that adds the fewest unused addresses. It also lists how the extra space shrinks as the route budget grows, so you can see whether a few more routes would make the summary much tighter. Make sure the extra space isn’t used anywhere else in your network before you advertise it.

How binary alignment controls aggregation

Two neighbouring blocks combine only when they have the same size and the first begins on the boundary of the larger block. For example, 192.0.2.0/25 and 192.0.2.128/25 form 192.0.2.0/24. By contrast, 192.0.2.128/25 and 192.0.3.0/25 are adjacent but cannot be represented by one exact CIDR because they cross a /24 boundary.

Summarising in OSPF, EIGRP, BGP and static routes

Each routing protocol has its own place to configure a summary, but the address maths is the same:

  • OSPF summarises between areas on an area border router, and into OSPF from other sources on an ASBR. A good address plan gives each area a block that summarises to one prefix.
  • EIGRP summarises on an interface. The router then adds a discard route for the summary automatically.
  • BGP creates aggregates from more-specific routes in its table. You can choose to advertise only the aggregate, or the aggregate and the more-specific routes together.
  • Static routes and cloud route tables simply list the summary prefix. Add a matching discard route on the summarising router, so traffic for unused addresses inside the summary is dropped instead of bouncing between routers.

The Show as menu above the exact list turns the result into a Cisco or Junos prefix list, Cisco Null0 discard routes, or Linux blackhole routes. Check the names, sequence numbers and next hops against your own configuration before you paste them in.

Important deployment check

A mathematically valid summary is not automatically safe to advertise. Confirm that the summarising router can reach every subnet inside the advertised prefix, install a discard route for the aggregate where appropriate, and check for more-specific routes, asymmetric paths and overlapping private address plans.

Frequently asked questions

How do I find the summary route for a list of networks?

Write the networks in binary, count the leading bits they all share, and use that count as the prefix length with the shared bits as the address. For 10.24.0.0/24 to 10.24.3.0/24 the shared bits give 10.24.0.0/22. Paste the networks above to get the result and any extra address space it covers.

What prefix summarises four /24 networks?

A /22, but only if the four networks are consecutive and the first starts on a /22 boundary, so the third octet of the first network is a multiple of 4. 10.40.0.0/24 to 10.40.3.0/24 make 10.40.0.0/22. Four /24s starting at 10.40.1.0 need more than one prefix.

How do I stay under a route limit such as AWS’s 100 VPN routes?

Enter the limit in the Route limit box. The calculator finds the set of that many prefixes or fewer that covers all your routes while adding the least unused address space, and shows the trade-off for smaller and larger budgets.

What is a discard or Null0 route?

It is a route for the summary prefix that drops traffic. Because more specific routes always win, traffic for real subnets still flows, while traffic for unused addresses inside the summary is dropped instead of looping between routers.

What is CIDR aggregation?

It is the replacement of multiple CIDR prefixes with fewer prefixes that represent the same address ranges. Exact aggregation reduces route count without adding address space.

What is the difference between aggregation and supernetting?

The terms often overlap. This calculator distinguishes an exact aggregate list from the single smallest supernet, which may cover unused gaps.

Can IPv4 and IPv6 routes be summarised together?

No. They are separate address families and must have separate route entries, so calculate each family independently.

Why will two adjacent subnets sometimes not combine?

CIDR blocks must be powers of two and aligned to their prefix boundary. Adjacency alone is not enough.

Does a summary change longest-prefix-match routing?

More-specific routes still win. A summary normally acts as a fallback, but it can attract traffic for uncovered gaps if no more-specific route exists.

← All networking calculators