BGP Aggregate AS-SET

This topic is to discuss the following lesson:

Hi Rene,
Just to be confirm , If we put the command aggregate-address 172.16.0.0 255.255.0.0 summary-only as-set on R1 then R2/R3 also get the prefix & discard based on as path , right ?Thanks

br//zaman

Hi Zaman,

If you add as-set then the AS numbers of the prefixes are included so if there is a link between R2/R4 and R3/R4 and they receive this aggregate, they will drop it because they see their own AS number yes.

Rene

Dear Rene,

If we set community for the aggregate-address and send this to eBGP speaker, on eBGP speaker can we see community for this aggregate-address.

//BR
Waqar

Hi Rene
is there a incorrect that is the As name.
where is the AS 3 ,in my opinion R3 will be in the AS 3

1 Like

Hello Bahri

Thanks for catching that! I’ve informed Rene and he will fix it.

Thanks again!

Laz

Hello Laz
thanks all
i m lucky because if laz is here no problem

1 Like

It’s fixed now, thanks for reporting!

I’m trying this exercise using 3 routers. R1-R2 iBGP peers, and R2-R3 eBGP peers.
i’ve configured a loopback interface on R1, 10.10.10.10/32 and on R2 i want to aggregate that /32 network in a /24 to R3 using the “aggregate-address 10.10.10.0 255.255.255.0” cli conf but i get this error ::
% BGP: Incorrect network or mask configurated

I’ve also tried with 255.0.0.0 and i get the same error on R2

Also i’ve checked with “show ip bgp” on R2 and the 10.10.10.10/32 is correctly injected in BGP table.

Hello Juan

In order to use the aggregate-address command to send an aggregate of 10.10.10.0/24, the corresponding loopback with an IP address within that range must be configured on the same router itself. The router will check your command against the IP addresses on the interfaces on the device and not against the BGP table. The problem is not the subnet mask, but the IP address that is not on a local interface.

Without having actually implemented the lab, my feeling is that If you want to issue the aggregate command, do so in R1. Try it out and let us know your results!

Laz

So…the aggregate-address command without summary-only option can only summarize the local IP addresses (like BGP auto-summary) as Laz mentioned and aggregate-address summary-only can advertise a summary of BGP learned routes (this is what R1 does in the lesson)?
If this is the case can you please add a note in the lesson?

Also to be picky (again) can you please update the lesson picture with the IP addresses (though the configuration pattern is clear)?

Many thanks,
Stefanita

Hello Stefanita,

The aggregate-address command can summarize anything that is in the BGP table. The summary-only option defines whether you advertise the summary route next to the regular route or only the summary route. Quick example:

R4#show run int l4
Building configuration...

Current configuration : 69 bytes
!
interface Loopback4
 ip address 123.123.123.123 255.255.255.0
end
R4#show run | section bgp
router bgp 4
 bgp log-neighbor-changes
 network 123.123.123.0 mask 255.255.255.0
 neighbor 192.168.14.1 remote-as 1

123.123.123.0/24 shows up on R1 like this:

R1#show ip bgp | include 123
 *>   123.123.123.0/24 192.168.14.4             0             0 4 i

And R1 forwards it to R2 and R3. Here’s R2:

R2#show ip bgp | include 123
 *>   123.123.123.0/24 192.168.12.1                           0 1 4 i

Let’s summarize it:

R1(config)#router bgp 1
R1(config-router)#aggregate-address 123.123.0.0 255.255.0.0

Now it shows up on R2 (and R3) like this:

R2#show ip bgp | include 123
 *>   123.123.0.0/16   192.168.12.1             0             0 1 i
 *>   123.123.123.0/24 192.168.12.1                           0 1 4 i

Let’s try the summary-only command:

R1(config)#router bgp 1
R1(config-router)#aggregate-address 123.123.0.0 255.255.0.0 summary-only 

And it shows up like this:

R2#show ip bgp | include 123
 *>   123.123.0.0/16   192.168.12.1             0             0 1 i

Does this help?

I updated the picture btw to add the network addresses and IP addresses :slight_smile:

Rene

2 Likes

This information is helpfull. Many thanks!

1 Like

Hi Rene and staff,
i lab the configuration of this lesson with my GNS3 to see how routing loops occur when R4 and R2 are peers and R4 and R3 too. But I have 2 questions first as i returned to the original configuration before setting aggregate command without AS-SET

First, look at the output from R1


In this output, i find 172.16.2.2/32 as a prefix that is advertised to R2. But this prefix came from R2: is it normal behavior of eBGP ? or is it a bug in my lab ?
On R2 things are OK

Second question
I set now the aggregate command on R1

Back to the previous command on R1


I understand that 172.16.0.0/16 is locally originated on R1 so it is the best route to the network /16. But why R1 does not advertise anymore 172.16.3.3/32 ? it is a subnet more specific than /16 that could be useful for R2 in its RIB. Is it a default behavior of BGP ? could this behavior be modified to advertised both /16 and /32 ? with what consequences ?
Regards

Hi,
sorry to add this in a different post.
But the question to understand my previous post is : why BGP could not advertised an aggregate-address only for a specific peer ? why do we have to set aggregate for all peers ?
I realize that i should search more options in the command and YEP, i found advertise-map or route-map that is probably the answer to my question ?
Perhaps the lesson should have more details on aggregate to see what is happening when aggegate is only set for a specifi peer ?
Regards

Hi Dominique,

That is strange, this is my output:

R1#show ip bgp
BGP table version is 6, local router ID is 192.168.14.1
Status codes: s suppressed, d damped, h history, * valid, > best, i - internal, 
              r RIB-failure, S Stale, m multipath, b backup-path, f RT-Filter, 
              x best-external, a additional-path, c RIB-compressed, 
              t secondary path, 
Origin codes: i - IGP, e - EGP, ? - incomplete
RPKI validation codes: V valid, I invalid, N Not found

     Network          Next Hop            Metric LocPrf Weight Path
 *>   172.16.0.0       0.0.0.0                            32768 i
 s>   172.16.2.2/32    192.168.12.2             0             0 2 i
 s>   172.16.3.3/32    192.168.13.3             0             0 3 i

This is what R1 advertises to R2:

R1#show ip bgp neighbors 192.168.12.2 advertised-routes 
BGP table version is 6, local router ID is 192.168.14.1
Status codes: s suppressed, d damped, h history, * valid, > best, i - internal, 
              r RIB-failure, S Stale, m multipath, b backup-path, f RT-Filter, 
              x best-external, a additional-path, c RIB-compressed, 
              t secondary path, 
Origin codes: i - IGP, e - EGP, ? - incomplete
RPKI validation codes: V valid, I invalid, N Not found

     Network          Next Hop            Metric LocPrf Weight Path
 *>   172.16.0.0       0.0.0.0                            32768 i

Total number of prefixes 1 

Because of the summary-only parameter, you only advertise the summary/aggregate. If you remove it, it will advertise the summary route and the specific routes. If you only advertise the summary route then you can keep your BGP tables smaller but the downside is that you don’t have as much routing information. In this topology, it doesn’t matter. R2 can only go anywhere except through R1.

Imagine R2 has a direct connection to R3 and R2/R3 are eBGP neighbors. Let’s say both R1 and R3 only advertise 172.16.0.0/16. In this case, R2 could pick R1 to go to 172.16.3.3/32. That’s not the best path though…this is an example why you might want to advertise the more specific route next to a summary/aggregate route.

Rene

This is how it works on Cisco IOS, just like adding a network command advertises the network to all neighbors. If you don’t want this, you’ll have to use a route-map.

The advertise-map works a bit different. It’s more like a “advertise network X when I have network Y in my routing table”.

Rene

Can you describe more about relation between As-set an AS-SEQ ??

Lets say that,In your diagram R2 sending 3 times AS-Path-prepend to the upstream for the prefix 172.16.2.0/24 to R1 and once R1 will do the summarization for this prefix to 172.16.0.0/16 then how that prepend attribute is going to behave ??

Hello Narad

According to RFC4271, the AS_PATH is an attribute that is composed of a sequence of AS path segments. Found within the update packet, there are the following fields:

  • path segment type - This can be a value of 1 which indicates AS_SET or 2 which indicates AS_SEQUENCE
  • path segment length - contains the number of ASes in the path segment value field
  • path segment value - one or more AS numbers, each encoded as a 2 octet length field.

So, sometimes the AS_SET is used, sometimes the AS_SEQUENCE is used. What’s the difference and when is each one used? Well, again according to the RFC:

  • AS_SET: unordered set of ASes a route in the UPDATE message has traversed
  • AS_SEQUENCE: ordered set of ASes a route in the UPDATE message has traversed

When is each type used? Well, under “normal” circumstances, AS_SEQUENCE is used, because it is useful and often necessary to know the order in which the ASes have been traversed. However, in the event you are using the aggregate-address command as is the case here in this lesson, then the ASes cannot and should not be displayed in order. They require an “unordered” format. This is further described in the 5.1.2 AS_PATH section of the RFC.

In this case, it will behave in the same manner as seen in the lesson. For example, if R2 sends an AS_PATH of 2 2 2, then the resulting BGP table of R4 would be:

R4#show ip bgp 
BGP table version is 11, local router ID is 192.168.14.4
Status codes: s suppressed, d damped, h history, * valid, > best, i - internal, 
              r RIB-failure, S Stale, m multipath, b backup-path, f RT-Filter, 
              x best-external, a additional-path, c RIB-compressed, 
              t secondary path, 
Origin codes: i - IGP, e - EGP, ? - incomplete
RPKI validation codes: V valid, I invalid, N Not found

     Network          Next Hop            Metric LocPrf Weight Path
 *>   172.16.0.0       192.168.14.1             0             0 1 {2 2 2,3} i

I hope this has been helpful!

Laz