Aggregation and Deaggregation
Topology: russo-bgp-iol

Load unix:agg.init.cfg
#R1-R6
configure replace unix:agg.init.cfg
R1 is announcing 192.0.2.128/27 and 192.0.2.160/27.
Aggregate these into a /26 on R4 and suppress the more-specifics.
Include R1’s ASN so that it will reject this aggregate from being advertised back to itself.
On R6, deaggregate this into 192.0.2.129/32 and 192.0.2.130/32.
Include a no-export community on the deaggregated prefixes so that these are not advertised back to ASN 65000.
Likewise for IPv6, R1 is announcing 2001:db8:100::/64 and 2001:db8:101::/64.
Aggregate these into a /40 on R4, supressing more-specifics and including R1’s ASN.
Deaggregate this into 2001:db8:100::1/128 and 2001:DB8:100::2/128 on R6, including a no-export community.
Answer
#R4
router bgp 65000
add ipv4
aggregate-address 192.0.2.128 255.255.255.192 summary-only as-set
add ipv6
aggregate-address 2001:db8:100::/40 summary-only as-set
#R6
ip prefix-list V4_MORE_SPECIFICS permit 192.0.2.129/32
ip prefix-list V4_MORE_SPECIFICS permit 192.0.2.130/32
ip prefix-list R4_V4_NEXTHOP permit 10.4.6.4/32
ip prefix-list V4_AGGREGATE permit 192.0.2.128/26
!
route-map V4_AGGREGATE
match ip addr prefix V4_AGGREGATE
match ip route-source prefix-list R4_V4_NEXTHOP
!
route-map V4_INJECT
set ip addr prefix V4_MORE_SPECIFICS
set community no-export
!
!
ipv6 prefix-list V6_MORE_SPECIFICS seq 5 permit 2001:DB8:100::1/128
ipv6 prefix-list V6_MORE_SPECIFICS seq 10 permit 2001:DB8:100::2/128
ipv6 prefix-list R4_V6_NEXTHOP seq 5 permit FC00:10:4:6::4/128
ipv6 prefix-list V6_AGGREGATE seq 5 permit 2001:DB8:100::/40
!
route-map V6_AGGREGATE permit 10
match ipv6 address prefix-list V6_AGGREGATE
match ipv6 route-source prefix-list R4_V6_NEXTHOP
!
route-map V6_INJECT permit 10
set community no-export
set ipv6 address prefix-list V6_MORE_SPECIFICS
!
router bgp 65006
add ipv4
bgp inject-map V4_INJECT exist-map V4_AGGREGATE
add ipv6
bgp inject-map V6_INJECT exist-map V6_AGGREGATE
Explanation
When creating an aggregate, the default behavior is:
Specifics are not suppressed
Suppress all specifics using summary-only
Suppress select specifics using suppress-map
Unsuppress specifics on a per-neighbor basis using neighbor unsuppress-map
The AS path information is lost, and all attributes are lost. Attributes are reset.
Include the attributes of the component routes using as-set. This creates an AS_PATH_SET attribute which is an unordered list of ASNs the aggregate has been generated from. This restores loop prevention. Additionally, attributes such as the community are included on the aggregate.
To set particular attributes, for example reset the community, use an attribute-map on the aggregate
To control which specifics contribute to the aggregate, and therefore have their attributes contributed when using as-set, use advertise-map
The ATOMIC_AGGREGATE attribute is created, which is just a tag that this is an aggregated route
The AGGREGATOR attribute is created, using the router’s RID and ASN
A router can deaggregate an aggregate into more specifics. This is configuration intensive, because you need a few route-maps and prefix-lists to do this. You match the aggregate using a prefix-list and a nexthop. You then create the more specifics using set ip address prefix-list. An example for IPv4 is below:
ip prefix-list V4_MORE_SPECIFICS permit 192.0.2.129/32
ip prefix-list V4_MORE_SPECIFICS permit 192.0.2.130/32
ip prefix-list R4_V4_NEXTHOP permit 10.4.6.4/32
ip prefix-list V4_AGGREGATE permit 192.0.2.128/26
!
route-map V4_AGGREGATE
match ip addr prefix V4_AGGREGATE
match ip route-source prefix-list R4_V4_NEXTHOP
!
route-map V4_INJECT
set ip addr prefix V4_MORE_SPECIFICS
set community no-export
!
router bgp 65006
add ipv4
bgp inject-map V4_INJECT exist-map V4_AGGREGATE
Verification
On R4 we can see that the aggregates have been correctly created. They include ASN 65001. Because there are no other ASNs contributing to the aggregate, this does not have to be an AS_PATH_SET.

We can also see that R4 is suppressing the more-specifics to R6:

The more-specific prefixes are marked with an s in the local BGP RIB on R4:

On R6, we see that the router has created the deaggregated prefixes, and they contain the correct no-export community.

A neat show command for displaying the deaggregated prefixes is show bgp ipv4 uni injected-paths.

If we remove the aggregates on R4, the injected-paths are no longer present on R6 (verified in the lab, but not shown).
Last updated