BGP · · 4 min read

BGP Route Aggregation and Summarization

The global IPv4 routing table has over 950,000 prefixes — and it keeps growing. Every network operator has a responsibility to advertise as few prefixes as reasonably possible. BGP route aggregation lets you advertise a single summary prefix instead of multiple more-specific ones, reducing the routing table burden on your peers and the internet at large.

aggregate-address Command

The aggregate-address command creates a summary from more-specific BGP routes already in the BGP table:

R1-HQ(config)# router bgp 65001
R1-HQ(config-router)# aggregate-address 10.1.0.0 255.255.0.0

Requirements:

summary-only

The most common option — suppresses the component routes and only advertises the summary:

R1-HQ(config-router)# aggregate-address 10.1.0.0 255.255.0.0 summary-only
R1-HQ# show ip bgp
   Network          Next Hop         Metric LocPrf Weight Path
*> 10.1.0.0/16      0.0.0.0                         32768 i
s> 10.1.1.0/24      0.0.0.0               0         32768 i
s> 10.1.2.0/24      0.0.0.0               0         32768 i
s> 10.1.3.0/24      0.0.0.0               0         32768 i

The s flag means "suppressed" — these /24s exist in the local BGP table but are NOT advertised to any peer. Only the /16 aggregate is sent.

as-set

When you aggregate routes from multiple ASes, the AS-path information is lost — the aggregate shows only your AS. This can break loop detection and hide the origin of the component routes.

The as-set option preserves AS-path information by creating an AS_SET (unordered set of all ASes in the component routes):

R1-HQ(config-router)# aggregate-address 10.0.0.0 255.0.0.0 summary-only as-set
R1-HQ# show ip bgp 10.0.0.0/8
BGP routing table entry for 10.0.0.0/8, version 30
Paths: (1 available, best #1, table default)
  {65002,65010}, (aggregated by 65001 1.1.1.1)
    0.0.0.0 from 0.0.0.0 (1.1.1.1)
      Origin IGP, weight 32768, valid, aggregated, local, atomic-aggregate, best

The {65002,65010} is the AS_SET — it tells downstream routers that ASes 65002 and 65010 are part of this aggregate. This preserves loop detection: if AS 65002 receives this route and sees itself in the AS_SET, it rejects it.

Warning: as-set means the aggregate's path attributes change whenever a component route is added or withdrawn. This can cause unnecessary churn — every component change triggers an UPDATE for the aggregate. Use judiciously.

suppress-map

Sometimes you want to suppress most component routes but keep advertising a few specific ones alongside the aggregate:

route-map SUPPRESS-MOST deny 10
 match ip address prefix-list KEEP-ADVERTISING
route-map SUPPRESS-MOST permit 20
!
ip prefix-list KEEP-ADVERTISING seq 10 permit 10.1.1.0/24
!
R1-HQ(config-router)# aggregate-address 10.1.0.0 255.255.0.0 suppress-map SUPPRESS-MOST

This suppresses all component routes EXCEPT 10.1.1.0/24 (denied by the suppress-map means "don't suppress this one"). Both the /16 aggregate and the /24 specific are advertised. Other /24s within 10.1.0.0/16 are suppressed.

attribute-map and advertise-map

attribute-map lets you set specific attributes on the aggregate (e.g., community, MED):

route-map AGG-ATTRIBUTES permit 10
 set community 65001:500
!
R1-HQ(config-router)# aggregate-address 10.1.0.0 255.255.0.0 summary-only attribute-map AGG-ATTRIBUTES

advertise-map controls which component routes are used to generate the aggregate — only routes matching the advertise-map are considered as components:

route-map ONLY-INTERNAL permit 10
 match ip address prefix-list INTERNAL-NETS
!
R1-HQ(config-router)# aggregate-address 10.1.0.0 255.255.0.0 summary-only advertise-map ONLY-INTERNAL

Aggregation vs network Command with Null Route

There's another common approach to advertising a summary: create a static null route and use the network command:

ip route 10.1.0.0 255.255.0.0 Null0
!
router bgp 65001
 network 10.1.0.0 mask 255.255.0.0

Differences:

Aspectaggregate-addressnetwork + null route
Component routes requiredYes — at least one must be in BGP tableNo — just needs the static route in IP RIB
Suppress componentsYes (summary-only)No — must filter separately
AS-SET supportYesNo
OriginIGP (aggregated)IGP
StabilityWithdrawn if all components disappearAlways present (null route is always up)

For advertising your own address space to the internet, the null route approach is often preferred because it's unconditionally stable — the route exists as long as the static route is configured, regardless of what's happening with more-specific routes in the BGP table.

Verification

R1-HQ# show ip bgp 10.1.0.0/16
BGP routing table entry for 10.1.0.0/16, version 28
Paths: (1 available, best #1, table default)
  Advertised to update-groups:
     1          2
  Local, (aggregated by 65001 1.1.1.1)
    0.0.0.0 from 0.0.0.0 (1.1.1.1)
      Origin IGP, weight 32768, valid, aggregated, local, best
      Aggregator: 65001 1.1.1.1

R1-HQ# show ip bgp neighbors 172.16.0.2 advertised-routes | include 10.1
*> 10.1.0.0/16      0.0.0.0                         32768 i

Only the /16 aggregate appears in advertised-routes — component /24s are suppressed.

Troubleshooting

SymptomCauseFix
Aggregate not appearing in BGP tableNo component routes in the BGP table within the aggregate rangeVerify component routes exist with show ip bgp longer-prefixes [aggregate]. Ensure they're in the BGP table, not just the IP routing table.
Component routes still being advertised despite summary-onlysummary-only keyword missing, or suppress-map permitting themVerify config: show run | section aggregate. Check for suppress-map exceptions.
Aggregate flapping (appearing/disappearing)Component routes are unstable — when the last one withdraws, the aggregate disappearsUse the null route + network approach for unconditional stability, or ensure component routes are stable.

Key Takeaways

Read next

© 2025 Ping Labz. All rights reserved.