Thursday, March 14, 2013

BGP - aggregate-address suppress-map

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. As you noticed the "aggregate-address <network> <netmask>" command actually advertised the aggregate route and the more specific 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>

You could presumably use summary-only to filter all the more specific routes, however what if you wanted to suppress only a selected few of the more specific routes and advertise the rest of the specific routes along with the aggregate? This is where "suppress-map" or "advertise-map" comes to the rescue  If you only had a few specific routes to advertise but a lot of specific routes to suppress out of an aggregate then you would use the "advertise-map" to advertise just what you want. However, if you only had a few specific routes to suppress but more specific prefixes to advertise then you would use a "suppress-map" to suppress what you want and advertise the rest. See below for "suppress-map" in action.

Objective:
  • Suppress 11.11.11.128/25 from being advertised to R3 but 11.11.11.0/25 and the aggregate should be advertised to R3. 
For the topology information, please take a look at my previous blogtorial.
 hostname R2  
 !  
 ip prefix-list suppress-pre seq 10 permit 11.11.11.128/25  
 !  
 route-map rm-suppress-map permit 10  
  match ip address prefix-list suppress-pre  
 !  
 router bgp 2  
  aggregate-address 11.11.11.0 255.255.255.0 suppress-map rm-suppress-map  
  • Permit what needs to be denied by specifying it the prefix-list.
  • Create a route-map to match the prefix-list.
  • Attach the route-map to the suppress-map parameter. 
Let's take a look at the R2 BGP table after the command has been applied.

 R2#show ip bgp  
 BGP table version is 5, local router ID is 2.2.2.2  
 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  1.1.1.1         0       0 1 i  
 *> 11.11.11.0/24  0.0.0.0              32768 i  
 s> 11.11.11.128/25 1.1.1.1         0       0 1 i  

Notice the "s" flag which means that route is suppressed and as you can see that route is not being advertised to R3.

 R2#show ip bgp nei 2.2.2.3 advertised-routes  
 Total number of prefixes 0  
 R2#show ip bgp nei 2.2.2.3 advertised-routes  
 BGP table version is 5, local router ID is 2.2.2.2  
 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  1.1.1.1         0       0 1 i  
 *> 11.11.11.0/24  0.0.0.0              32768 i  

Have you used this before? Where would you use this feature?

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.