aggregate

Use aggregate to create a summary route in the BGP routing table.

Use undo aggregate to remove a summary route.

Syntax

In BGP IPv4 unicast address family view/BGP-VPN IPv4 unicast address family view:

aggregate ip-address { mask | mask-length } [ as-set | attribute-policy route-policy-name | detail-suppressed | origin-policy route-policy-name | suppress-policy route-policy-name ] *

undo aggregate ip-address { mask | mask-length }

In BGP IPv6 unicast address family view:

aggregate ipv6-address prefix-length [ as-set | attribute-policy route-policy-name | detail-suppressed | origin-policy route-policy-name | suppress-policy route-policy-name ] *

undo aggregate ipv6-address prefix-length

Default

No summary route is configured.

Views

BGP IPv4 unicast address family view, BGP-VPN IPv4 unicast address family view, BGP IPv6 unicast address family view

Predefined user roles

network-admin

mdc-admin

Parameters

ip-address: Specifies a summary address.

mask: Specifies a mask for the summary address, in dotted decimal notation.

mask-length: Specifies a mask length for the summary address, in the range of 0 to 32.

ipv6-address: Specifies an IPv6 summary address.

prefix-length: Specifies a prefix length for the IPv6 summary address, in the range of 0 to 128.

as-set: Enables the AS_PATH attribute of the summary route to contain the AS path information of all summarized routes. The AS_PATH attribute is of the AS_SET type that requires no sequence when arranging AS numbers. If this keyword is not specified, the AS_PATH attribute of the summary route contains only the AS number of the local router.

attribute-policy route-policy-name: Specifies a routing policy by its name, a case-sensitive string of 1 to 63 characters, to set attributes for the summary route.

detail-suppressed: Advertises only the summary route. If this keyword is not specified, BGP advertises both the summary route and the more specific routes.

origin-policy route-policy-name: Specifies a routing policy by its name, a case-sensitive string of 1 to 63 characters, to select routes to be summarized.

suppress-policy route-policy-name: Specifies a routing policy by its name, a case-sensitive string of 1 to 63 characters, to filter more specific routes to be advertised. Routes permitted by the specified routing policy are not advertised. Routes denied by the specified routing policy are advertised.

Usage guidelines

This command creates a summary route. If the BGP routing table has routes whose destination addresses fall within the specified network, the summary route is added to the BGP routing table. For example, if two routes 10.1.1.0/24 and 10.1.2.0/24 exist in the BGP routing table, configuring the aggregate 10.1.0.0 16 command creates a summary route 10.1.0.0/16.

If the summarized routes have different ORIGIN attributes, the summary route selects the ORIGIN attribute in the sequence of INCOMPLETE, EGP, and IGP. For example, if the ORIGIN attributes of the summarized routes include INCOMPLETE and IGP, the ORIGIN attribute of the summary route is INCOMPLETE.

If the summarized routes have different COMMUNITY (or extended community) attribute values and the summary route does not have the ATOMIC_AGGREGATE attribute, the COMMUNITY attribute of the summary route carries all the COMMUNITY (or extended community) attribute values.

Table 66: Functions of the keywords

Keywords

Function

as-set

Enables the summary route to carry the AS path information of all summarized routes. This feature can help avoid routing loops. However, if many routes are summarized and are changed frequently, do not specify this keyword because this configuration causes the summary route to flap with the more specific routes.

attribute-policy

Sets attributes except the AS-PATH attribute for the summary route. The peer route-policy command can achieve the same purpose.

detail-suppressed

Disables advertisement of all more specific routes. To disable advertisement of some more specific routes, use the suppress-policy keyword or the peer filter-policy command.

origin-policy

Summarizes only routes matching a routing policy.

If the destination address of a route falls within the summary network but does not match the routing policy, the route is not summarized, and is not controlled by the detail-suppressed and suppress-policy keywords.

There is no need to configure apply clauses for the routing policy referenced by the origin-policy keyword because they do not take effect.

suppress-policy

Disables advertisement of some more specific routes filtered by a routing policy. The routing policy uses if-match clauses to filter routes.

There is no need to configure apply clauses for the routing policy referenced by the suppress-policy keyword because they do not take effect.

Examples

# In BGP IPv4 unicast address family view, create a summary route 1.1.0.0/16 in the BGP routing table.

<Sysname> system-view
[Sysname] bgp 100
[Sysname-bgp] address-family ipv4 unicast
[Sysname-bgp-ipv4] aggregate 1.1.0.0 255.255.0.0

# In BGP IPv4 unicast address family view, create a summary route 1.1.0.0/16 in the BGP routing table. Specify the AS_PATH attribute for the summary route to contain the AS path information of all summarized routes, and advertise only the summary route.

<Sysname> system-view
[Sysname] bgp 100
[Sysname-bgp] address-family ipv4 unicast
[Sysname-bgp-ipv4] aggregate 1.1.0.0 255.255.0.0 as-set detail-suppressed

# In BGP IPv4 unicast address family view, create a summary route 1.1.0.0/16 in the BGP routing table, and set the COMMUNITY attribute of the summary route to INTERNET.

<Sysname> system-view
[Sysname] route-policy commu permit node 0
[Sysname-route-policy-commu-0] apply community internet
[Sysname-route-policy-commu-0] quit
[Sysname] bgp 100
[Sysname-bgp] address-family ipv4 unicast
[Sysname-bgp-ipv4] aggregate 1.1.0.0 255.255.0.0 attribute-policy commu

# In BGP IPv4 unicast address family view, create a summary route 1.1.0.0/16 in the BGP routing table, and configure BGP to not summarize route 1.1.1.0/24.

<Sysname> system-view
[Sysname] ip prefix-list spert deny 1.1.1.0 24
[Sysname] ip prefix-list spert permit 0.0.0.0 0 less-equal 32
[Sysname] route-policy srcrt permit node 0
[Sysname-route-policy-srcrt-0] if-match ip address prefix-list spert
[Sysname-route-policy-srcrt-0] quit
[Sysname] bgp 100
[Sysname-bgp] address-family ipv4 unicast
[Sysname-bgp-ipv4] aggregate 1.1.0.0 255.255.0.0 origin-policy srcrt

# In BGP IPv4 unicast address family view, create a summary route 1.1.0.0/16 in the BGP routing table, and disable BGP to advertise the specific route 1.1.1.0/24.

<Sysname> system-view
[Sysname] ip prefix-list spert permit 1.1.1.0 24
[Sysname] ip prefix-list spert deny 0.0.0.0 0 less-equal 32
[Sysname] route-policy suprt permit node 0
[Sysname-route-policy-suprt-0] if-match ip address prefix-list spert
[Sysname-route-policy-suprt-0] quit
[Sysname] bgp 100
[Sysname-bgp] address-family ipv4 unicast
[Sysname-bgp-ipv4] aggregate 1.1.0.0 255.255.0.0 suppress-policy suprt

# In BGP-VPN IPv4 unicast address family view, create a summary route 1.1.0.0/16 in BGP routing table.

<Sysname> system-view
[Sysname] bgp 100
[Sysname-bgp] ip vpn-instance vpn1
[Sysname-bgp-vpn1] address-family ipv4 unicast
[Sysname-bgp-ipv4-vpn1] aggregate 1.1.0.0 255.255.0.0

# In BGP IPv6 unicast address family view, create a summary route 12::/64 in the IPv6 BGP routing table.

<Sysname> system-view
[Sysname] bgp 100
[Sysname-bgp] address-family ipv6
[Sysname-bgp-ipv6] aggregate 12:: 64

Related commands

display bgp routing-table ipv4 unicast

display bgp routing-table ipv6 unicast

summary automatic