Why aggregate
Each prefix in the BGP table costs memory on every router that holds it, and every change is an UPDATE that reaches all of them. An organisation with four neighbouring /24s that advertises each separately adds four entries to the global table. Advertised as a single /22 it adds one, and a flap inside it is invisible outside.
On small screens, swipe sideways or focus the diagram and use the arrow keys.
Configuring aggregate-address
The aggregate is created inside the BGP address family. Without options, it is advertised together with the more-specific routes: the neighbour gets the /22 and the four /24s, so nothing is saved and only the covering route is added.
router bgp 64500
address-family ipv4 unicast
aggregate-address 198.51.100.0 255.255.252.0 summary-onlyR1. Creates 198.51.100.0/22 while any contributor is in the BGP table, and with summary-only suppresses the four /24 contributors towards every neighbour.
On small screens, swipe sideways or focus the diagram and use the arrow keys.
R1#show ip bgp 198.51.100.0/22 BGP routing table entry for 198.51.100.0/22, version 6 Paths: (1 available, best #1, table default) Advertised to update-groups: 1 Local, (aggregated by 64500 192.0.2.254) 0.0.0.0 from 0.0.0.0 (192.0.2.254) Origin IGP, localpref 100, weight 32768, valid, aggregated, local, atomic-aggregate, best
aggregated by 64500 192.0.2.254 is the AGGREGATOR attribute: which AS and which router built the summary. atomic-aggregate warns that path information was lost in summarising.R1#show ip route 198.51.100.0 255.255.252.0 Routing entry for 198.51.100.0/22 Known via "bgp 64500", distance 200, metric 0, type locally generated Routing Descriptor Blocks: * directly connected, via Null0 Route metric is 0, traffic share count is 1
summary-only or not
On small screens, swipe sideways or focus the diagram and use the arrow keys.
Without summary-only the more-specific routes are still sent. That is sometimes what you want. Traffic engineering across two providers often means advertising the /22 to both and the /24s only to one so inbound traffic prefers it, since the longest match wins.
Control which routes are suppressed
summary-only is all or nothing. When you need to suppress some specifics and send others, use a suppress-map to name the routes to hide, and an unsuppress-map to let a hidden route through to one neighbour only.
On small screens, swipe sideways or focus the diagram and use the arrow keys.
ip prefix-list HIDE-THESE seq 5 permit 198.51.101.0/24
ip prefix-list HIDE-THESE seq 10 permit 198.51.103.0/24
!
route-map SUPPRESS-SOME permit 10
match ip address prefix-list HIDE-THESE
!
router bgp 64500
address-family ipv4 unicast
aggregate-address 198.51.100.0 255.255.252.0 suppress-map SUPPRESS-SOMER1. Hides two of the four contributors and still advertises the other two alongside the aggregate.
The AS path of an aggregate: atomic-aggregate and as-set
The AS path is how BGP prevents loops. If four routes with different AS paths become one aggregate with an empty path, that information is gone. BGP gives you two attributes to deal with it.
On small screens, swipe sideways or focus the diagram and use the arrow keys.
- ATOMIC_AGGREGATE is a flag. It says: this route is a summary, and AS path information was dropped. Receivers must not de-aggregate it into more specifics. IOS sets it automatically when contributors had AS paths and they were not kept.
- AS_SET keeps the AS numbers. With
as-set, the aggregate carries an unordered set of every AS from the contributors, such as{64501 64502}, so loop prevention still works. An AS_SET counts as a single hop for path length. The ATOMIC_AGGREGATE flag is then not set.
R1#show ip bgp 198.51.100.0/22 BGP routing table entry for 198.51.100.0/22, version 9 Paths: (1 available, best #1, table default) {64501,64502}, (aggregated by 64500 192.0.2.254) 0.0.0.0 from 0.0.0.0 (192.0.2.254) Origin IGP, localpref 100, weight 32768, valid, aggregated, local, best
Troubleshooting an aggregate that is missing
On small screens, swipe sideways or focus the diagram and use the arrow keys.
The most common mistake is expecting the aggregate when the contributors are only in the RIB. A static or OSPF route inside the block is not enough. It must be in the BGP table, which means a network statement or redistribution for it.
Technical reference: RFC 4271, section 9.2.2.2 on aggregation, and RFC 4632, CIDR. Output above is illustrative.
Check your understanding
You configure aggregate-address 198.51.100.0 255.255.252.0 with no keywords. How many routes does a neighbour receive for that block?
The routing table has a static route for 198.51.101.0/24 but no BGP route for it. No other contributor exists. What happens to the aggregate?
Why would you add as-set to an aggregate built from routes learned from two different ASes?