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.0Requirements:
- At least one more-specific prefix within the aggregate range must exist in the BGP table (not just the IP routing table)
- The aggregate is generated locally — it has a next-hop of 0.0.0.0 and AS-path is empty (just your AS)
- Without
summary-only, both the aggregate AND the component routes are advertised
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-onlyR1-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 iThe 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-setR1-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, bestThe {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-MOSTThis 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-ATTRIBUTESadvertise-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-INTERNALAggregation 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.0Differences:
| Aspect | aggregate-address | network + null route |
|---|---|---|
| Component routes required | Yes — at least one must be in BGP table | No — just needs the static route in IP RIB |
| Suppress components | Yes (summary-only) | No — must filter separately |
| AS-SET support | Yes | No |
| Origin | IGP (aggregated) | IGP |
| Stability | Withdrawn if all components disappear | Always 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 iOnly the /16 aggregate appears in advertised-routes — component /24s are suppressed.
Troubleshooting
| Symptom | Cause | Fix |
|---|---|---|
| Aggregate not appearing in BGP table | No component routes in the BGP table within the aggregate range | Verify 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-only | summary-only keyword missing, or suppress-map permitting them | Verify 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 disappears | Use the null route + network approach for unconditional stability, or ensure component routes are stable. |
Key Takeaways
aggregate-addresscreates a BGP summary from existing more-specific routes in the BGP table. Usesummary-onlyto suppress components.as-setpreserves AS-path information in the aggregate — important for loop prevention when aggregating multi-AS routes.- Use
suppress-mapto selectively keep advertising specific components alongside the aggregate. - For unconditional route stability, consider a null route +
networkcommand instead of aggregate-address. - Aggregating reduces global routing table size — advertise the shortest prefix your allocation supports, and suppress more-specifics unless you have a traffic engineering reason to advertise them.