Thursday, March 14, 2013

BGP - aggregate-address as-set

In my previous blogtorial we utilized the aggregate-address command to summarize routes in BGP. In this blogtorial we will take a look at one of the optional parameters we can use with the aggregate-address command to manipulate routes.

 R2(config-router)#aggregate-address 11.11.11.0 255.255.255.0 ?  
  advertise-map Set condition to advertise attribute  
  as-set     Generate AS set path information  
  attribute-map Set attributes of aggregate  
  nlri      Nlri aggregate applies to  
  route-map   Set parameters of aggregate  
  summary-only  Filter more specific routes from updates  
  suppress-map  Conditionally filter more specific routes from updates  
  <cr>  

The optional parameter we will look at in this blogtorial is the as-set option. In my previous post we talked about "atomic-aggregate" and how the aggregate routes clears the AS_PATH information along with other attributes of the route such as no-export community. For example, let's take a look at the R3.

R3#show ip bgp
BGP table version is 4, local router ID is 2.2.2.3
Status codes: s suppressed, d damped, h history, * valid, > best, i - internal,
              r RIB-failure, S Stale
Origin codes: i - IGP, e - EGP, ? - incomplete

   Network          Next Hop            Metric LocPrf Weight Path
*> 11.11.11.0/25    2.2.2.2                                0 2 1 i
*> 11.11.11.0/24    2.2.2.2                  0             0 2 i
*> 11.11.11.128/25  2.2.2.2                                0 2 1 i

R3#show ip bgp 11.11.11.0 255.255.255.0
BGP routing table entry for 11.11.11.0/24, version 3
Paths: (1 available, best #1, table Default-IP-Routing-Table)
Flag: 0x820
  Not advertised to any peer
  2, (aggregated by 2 2.2.2.2)
    2.2.2.2 from 2.2.2.2 (2.2.2.2)
      Origin IGP, metric 0, localpref 100, valid, external, atomic-aggregate, best

Notice that the AS_PATH for the aggregate route shows just the ASN 2 even though the 11.11.11.0 network is actually originated from AS1 (R1). The more specific prefixes actually retains the AS_PATH {2 1}. The "as-set" option enables the routes to retain the AS_PATH information along with other attributes (no-export, no-advertise communities and etc) and it could be used to prevent loops.

After I apply the as-set option notice the AS_PATH on R3 for 11.11.11.0/24 is now {2 1}.

 R2#conf t  
 R2(config)#router bgp 2  
 R2(config-router)#aggregate-address 11.11.11.0 255.255.255.0 summary-only as-set  

 R3#show ip bgp  
 BGP table version is 21, local router ID is 2.2.2.3  
 Status codes: s suppressed, d damped, h history, * valid, > best, i - internal,  
        r RIB-failure, S Stale  
 Origin codes: i - IGP, e - EGP, ? - incomplete  
   Network     Next Hop      Metric LocPrf Weight Path  
 *> 11.11.11.0/25    2.2.2.2                0      2 1 i
 *> 11.11.11.0/24  2.2.2.2         0        0      2 1 i 
 *> 11.11.11.128/25  2.2.2.2                0      2 1 i

Many more articles to come so stay tuned.

Please reshare/subscribe/comment/+1 if you like my posts as it keeps me motivated to write more and spread the knowledge.

No comments:

Post a Comment