BGP Aggregate AS-SET

When you use the BGP aggregate-address command on Cisco IOS without any parameters, then all information of individual route attributes such as AS_PATH is lost.

This can cause issues since the AS_PATH is used for loop prevention. For example, it’s possible that an AS installs a summary that it shouldn’t. With the AS-SET parameter, you can optionally include AS information in the summary. In this lesson, I’ll show you how to do this.

Configuration

Here is the topology we’ll use:

Bgp Aggregate As Set Topology Lab

We have four routers, all in a different AS. R2 and R3 have a loopback with an IP address that are advertised in BGP. R1 will send an aggregate to R4.

When you use the BGP aggregate-address command on Cisco IOS without any parameters, then all information of individual route attributes such as AS_PATH is lost. This can cause issues since the AS_PATH is used for loop prevention. For example, it's possible that an AS installs a summary that it shoul



Configurations

Want to take a look for yourself? Here you will find the startup configuration of each device.

R1

hostname R1
!
ip cef
!
interface GigabitEthernet0/1
 ip address 192.168.12.1 255.255.255.0
!
interface GigabitEthernet0/2
 ip address 192.168.13.1 255.255.255.0
!
interface GigabitEthernet0/3
 ip address 192.168.14.1 255.255.255.0
!
router bgp 1
 neighbor 192.168.12.2 remote-as 2
 neighbor 192.168.13.3 remote-as 3
 neighbor 192.168.14.4 remote-as 4
!
end

R2

hostname R2
!
ip cef
!
interface Loopback0
 ip address 172.16.2.2 255.255.255.255
!
interface GigabitEthernet0/1
 ip address 192.168.12.2 255.255.255.0
!
router bgp 2
 network 172.16.2.2 mask 255.255.255.255
 neighbor 192.168.12.1 remote-as 1
!
end

R3

hostname R3
!
ip cef
!
interface Loopback0
 ip address 172.16.3.3 255.255.255.255
!
interface GigabitEthernet0/1
 ip address 192.168.13.3 255.255.255.0
!
router bgp 3
 network 172.16.3.3 mask 255.255.255.255
 neighbor 192.168.13.1 remote-as 1
!
end

R4

hostname R4
!
ip cef
!
interface GigabitEthernet0/1
 ip address 192.168.14.4 255.255.255.0
!
router bgp 4
 neighbor 192.168.14.1 remote-as 1
!
end

Right now, there is no aggregate so R4 sees two separate prefixes with the correct AS path information:

R4#show ip bgp 
BGP table version is 3, 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.2.2/32       192.168.14.1                           0 1 2 i
 *>   172.16.3.3/32       192.168.14.1                           0 1 3 i

Each prefix has the correct AS path.

Without AS-SET

Let’s create a summary/aggregate. We’ll start without the AS-SET parameter so that we have a before and after example:

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

Here’s what we get on R4:

R4#show ip bgp 
BGP table version is 10, 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 i

We see the 172.16.0.0/16 prefix but all AS path information is lost. This prefix seems to come from AS 1 only.

If R4 was connected to R2 or R3 then those routers would install this prefix without hesitation since they don’t see their own AS number in the summary route. This could cause routing loops.

With AS-SET

Let’s add the as-set parameter on R1 now:

R1(config)#router bgp 1
R1(config-router)#aggregate-address 172.16.0.0 255.255.0.0 summary-only as-set

Here’s what we get on R4:

We're Sorry, Full Content Access is for Members Only...

If you like to keep on reading, Become a Member Now! Here is why:

  • Learn any CCNA, CCNP and CCIE R&S Topic. Explained As Simple As Possible.
  • Try for Just $1. The Best Dollar You've Ever Spent on Your Cisco Career!
  • Full Access to our 654 Lessons. More Lessons Added Every Week!
  • Content created by Rene Molenaar (CCIE #41726)

538 Sign Ups in the last 30 days

satisfaction-guaranteed
100% Satisfaction Guaranteed!
You may cancel your monthly membership at any time.
No Questions Asked!

Tags:


Forum Replies

  1. 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

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

  3. 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

  4. 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:

    ... Continue reading in our forum

11 more replies! Ask a question or join the discussion by visiting our Community Forum