Overview

The aggregate-address command for aggregating BGP routes on Cisco routers has many options. The options are divided into two categories.

  • What to do with the attributes of the aggregate route
  • How to handle pre-aggregation routes

The attribute-map is an option for “what to do with the attributes of the aggregate route”. The attribute-map allows attributes to be added to the aggregate route.

aggregate-address command : attribute-map option

Aggregate route generated by the aggregate-address command naturally has path attributes added to it as well. By default, the following path attributes are added.

  • ORIGIN:IGP
  • NEXT_HOP:0.0.0.0
  • AS_PATH: empty
  • WEIGHT:32768
  • LOCAL_PREFERENCE:100
  • MED: none
  • AGGREGATOR: Local AS number and Router ID
  • ATOMIC-AGGREGATE

Attributes such as MED, LOCAL_PREFERENCE, and COMMUNITY can be added when generating aggregate routes using the attribute-map option.

Figure: attribute-map sets attributes when generating aggregate route
Figure: attribute-map sets attributes when generating aggregate route

The attribute-map option specifies the route map name. The route-map set command sets the attribute to be added to the aggregate route.

aggregate-address attribute-map

(config)#router bgp <AS>
(config-router)#aggregate-address <network-address> <subnetmask> attribute-map <route-map-name>

<AS>: AS number
<network-address>: Network address of the aggregate route
<subnetmask>: Subnet mask of the aggregate route
<route-map-name>: route-map name

The route map specified by attribute-map does not need to match condition. This is because the target is determined to be an aggregate route.

aggregate-address attribute-map configuration example

Network diagram and Initial configuration

Configure the attribute-map option for aggregate-address on R1 in the following network diagram.

Figure: aggregate-address attribute-map option configuration example network diagram
Figure: aggregate-address attribute-map option configuration example network diagram

The BGP-related configuration for R1 and R2 prior to configuring aggregate-address is as follows

R1 Initial Configuration

interface Loopback0
 ip address 100.1.2.1 255.255.255.0 secondary
 ip address 100.1.3.1 255.255.255.0 secondary
 ip address 100.1.4.1 255.255.255.0 secondary
 ip address 100.1.1.1 255.255.255.0
!
router bgp 1
 network 100.1.1.0 mask 255.255.255.0
 network 100.1.2.0 mask 255.255.255.0
 network 100.1.3.0 mask 255.255.255.0
 network 100.1.4.0 mask 255.255.255.0
 neighbor 12.12.12.2 remote-as 2
 neighbor 12.12.12.2 send-community
 ip bgp-community new-format

R1 has established an EBGP neighbor with R2 and advertises routes 100.1.1.0/24 through 100.1.4.0/24 with the network command.

R2 Initial Configuration

router bgp 2
 neighbor 12.12.12.1 remote-as 1
 neighbor 12.12.12.1 send-community
 ip bgp-community new-format

R2 simply configures an EBGP neighbor with R1.

Since COMMUNITY attributes are handled, the following commands are also configured on R1 and R2.

  • neighbor send-community
  • ip bgp-community new-format

The neighbor send-community command does not remove the COMMUNITY attribute that is added to the BGP route.The ip bgp-community new-format command is configured to make the COMMUNITY notation clearer.

Advertise aggregate route on R1

Generate route information 100.1.0.0/16, which aggregates 100.1.1.0/24 to 100.1.4.0/24 on R1.

R1 Generate aggregate route

router bgp 1
 aggregate-address 100.1.0.0 255.255.0.0

With this configuration, the aggregate route 100.1.0.0/16 is generated, placed in the BGP table, and advertised to R2. Verify the attribute of the aggregate route 100.1.0.0/16 at this time. To do so, view the results of show ip bgp 100.1.0.0 on R1.

R1 Verifying Aggregate Route Attributes

R1#sh ip bgp 100.1.0.0
BGP routing table entry for 100.1.0.0/16, version 6
Paths: (1 available, best #1, table Default-IP-Routing-Table)
Advertised to non peer-group peers:
12.12.12.2
Local, (aggregated by 1 100.1.1.1)
0.0.0.0 from 0.0.0.0 (100.1.1.1)
Origin IGP, localpref 100, weight 32768, valid, aggregated, local, atomic-aggregate, best

Aggregate route attributes are marked with atomic-aggregate and aggregator, but other attributes such as Origin and Local_preference are the same as the route generated by the network command.

Adding attributes to aggregate routes can also be done by applying a route-map outbound when advertising. However, with attribute-map, attributes can be added when aggregate route is generated.

Attribute addition to aggregate route using attribute-map

Let’s use attibute-map to add COMMUNITY to the aggregate route. After the attribute-map, specify a route map. This route map should be considered very simple. The match condition is not required for the route map after attribute-map, since the aggregate route generated by the aggregate-address command is the target, so there is no need to specify match condition. Just use the set command alone to set the attributes you want to add to the aggregate route.

Now, as an example, let’s consider configuring an attribute-map to add COMMUNITY 1:1000 to an aggregate route. First, create a route-map (AGG_COM) to add COMMUNITY as follows

R1 Configure route-map for attribute-map

route-map AGG_COM permit 10
 set community 1:1000

This route map is then applied with the attribute-map option of aggregate-address command.

R1 attribute-map option

router bgp 1
 aggregate-ddress 100.1.0.0 255.255.0.0 attribute-map AGG_COM

This will add COMMUNITY 1:1000 to the aggregate route 100.1.0.0/16. Let’s verify this by viewing the BGP table on R1.

R1 Aggregate route 100.1.0.0/16

R1#sh ip bgp 100.1.0.0
BGP routing table entry for 100.1.0.0/16, version 7
Paths: (1 available, best #1, table Default-IP-Routing-Table)
Advertised to non peer-group peers:
12.12.12.2
Local, (aggregated by 1 100.1.1.1)
0.0.0.0 from 0.0.0.0 (100.1.1.1)
Origin IGP, localpref 100, weight 32768, valid, aggregated, local, atomic-aggregate, best
Community: 1:1000

If detailed information on the aggregate route 100.1.0.0/16 in the BGP table is verified, you can see that COMMUNITY 1:1000 is appended in the last line.

Figure: Adding COMMUNITY to an Aggregate Route using attribute-map
Figure: Adding COMMUNITY to an Aggregate Route using attribute-map

Let’s also look on R2, which receives this route.

R2 BGP Table

R2#sh ip bgp 100.1.0.0
BGP routing table entry for 100.1.0.0/16, version 7
Paths: (1 available, best #1, table Default-IP-Routing-Table)
Flag: 0x880
Not advertised to any peer
1, (aggregated by 1 100.1.1.1)
12.12.12.1 from 12.12.12.1 (100.1.1.1)
Origin IGP, metric 0, localpref 100, valid, external, atomic-aggregate, best
Community: 1:1000

On R2, you can also see that the aggregate route 100.1.0.0/16 with COMMUNITY 1:1000 is also being received.

Summary

Points

  • attribute-map is an option for “what to do with the attributes of the aggregate route”. It is used to add attributes to the aggregate route.
  • Specify a route map after attribute-map. The route map is set to the attribute to be added without the match condition.