BGP Aggregate as-set

      1 Comment on BGP Aggregate as-set

When advertising aggregates in BGP, it’s possible to specify the ‘as-set’ command as part of the aggregate.  This forces the BGP process to advertise the prefix with a list of AS numbers that make up the aggregate.  So let’s take our lab where we left it so I can show you what I mean…

image

Let’s look at the BGP table on the ISP A routers before we do this…

image

image

Note that the aggregate each ISP A router is injecting (175.15.0.0/18) does not list an AS-path.  That’s because each router is generating the prefix.  We can confirm this by looking at the upstreamISP router’s BGP table…

image

Here you can see that the AS-path is set to 200 for the 175.15.0.0./18 prefix.  Now, let’s change things up and enable the ‘as-set’ command on the aggregate statement…

image

image

Looking at the BGP table, we now see the AS-path is set to something completely different…

image

image

Note that the AS-path lists {100,300}.  These are the two AS numbers that make up the aggregate.  That is, the /20 prefixes from AS 100 and 300 are what allow the aggregate to be advertised.  AS sets are treated as a single AS for AS-path length and can really only be used for loop prevention.  They can not be used for path determination. 

Now, let’s check out the upstreamISP router’s BGP table…

image

Huh…  What could be wrong?  Well, without spending a lot of time troubleshooting, let me tell you what happens when you use the ‘as-set’ command.  The ‘as-set’ command will copy any communities from the prefixes that comprise the aggregate to the aggregate prefix.  In other words, this should help clear up the issue…

image

From some previous labbing, I had left an outbound route-map on the ISP B and C routers that set the no-export community on the prefixes advertised up to ISP A.  When I configured the ‘as-set’ command, it got copied over to the aggregate which then does not get advertised to the upstreamISP. 

As luck would have it, there’s a creative way to fix this issue without removing the outbound route-map on ISP B and C.  Attribute maps are a way to set prefix attributes on aggregate prefixes.  Let’s configure them on the ISP A routers…

image

Above I show the configuration on one of the routers.  Basically, I created a route-map that just set the community to none.  This will effectively clear any communities from the prefix the route-map is associated to.  I then added the attribute-map to the aggregate address command for the aggregate.  I made a similar configuration on the other.  Now, if we look at the upstreamISP router, we should see the prefixes are once again present…

image

And there you have it!

1 thought on “BGP Aggregate as-set

Leave a Reply to manoj Cancel reply

Your email address will not be published. Required fields are marked *