How does BGP aggregation work, and what do summary-only and as-set do?
Show the answer
Say this first
aggregate-address creates a summary in BGP as long as at least one more specific component is in the BGP
table. By default the specifics are still advertised alongside the summary; summary-only suppresses them
(they show as s). The aggregate starts a fresh AS path and carries ATOMIC_AGGREGATE and AGGREGATOR. With
as-set it keeps the component ASNs in an AS_SET instead, at the cost of re-advertising the aggregate whenever
a component changes.
Go deeper
router bgp 64500
network 203.0.113.0 mask 255.255.255.128
network 203.0.113.128 mask 255.255.255.128
aggregate-address 203.0.113.0 255.255.255.0 summary-onlyBoth /25s are connected LAN subnets, so the network statements match.
R1# show ip bgp | begin Network
Network Next Hop Metric LocPrf Weight Path
*> 203.0.113.0 0.0.0.0 32768 i
s> 203.0.113.0/25 0.0.0.0 0 32768 i
s> 203.0.113.128/25 0.0.0.0 0 32768 iIOS also installs the aggregate in the routing table pointing to Null0 with distance 200, which prevents loops for unused parts of the block.
Finer control
suppress-mapsuppresses only some components.unsuppress-mapon one neighbor leaks chosen specifics to that peer only.as-setkeeps loop detection but is discouraged today (RFC 6472), and RPKI origin validation cannot validate an AS_SET origin.
They will ask next
How is this different from a static route to Null0 plus a network statement?
The static method always advertises the summary, even if nothing behind it is up. aggregate-address advertises only while at least one component exists in BGP. Many edge designs prefer the static anchor for stability.
Traps
- Forgetting
summary-onlyand announcing both the /24 and the /25s. - Configuring an aggregate with no component in the BGP table and wondering why nothing is advertised.