Monday, June 9, 2008

BGP aggregation with unsuppress-map option

In a previous post we learned how to aggregate BGP routes and use the suppress-map to suppress certain component routes from being advertised. With the summary-only option on the aggregate-address command you can suppress ALL component subnets. Suppose you had a bunch of component routes but only wanted to advertise a few, it would be a lot of work to make that big of a suppress-map. I don't know the exact reason behind this, but you can instead use the summary-only option of the aggregate-address command and then use an unsuppress-map to advertise the few component subnets you want. Here's how:

Topology:
R1 [AS 100] connects to R2 [AS 200]

R1 is currently summarizing a bunch of subnets in the 1.0.0.0/8 range.

R1# show ip route | in C
Codes: C - connected, S - static, I - IGRP, R - RIP, M - mobile, B - BGP
C 1.1.1.1/32 is directly connected, Loopback0
C 1.3.3.3/32 is directly connected, Loopback3
C 1.2.2.2/32 is directly connected, Loopback2
C 1.5.5.5/32 is directly connected, Loopback5
C 1.4.4.4/32 is directly connected, Loopback4
C 1.7.7.7/32 is directly connected, Loopback7
C 1.6.6.6/32 is directly connected, Loopback6

R1 is configured as such:

router bgp 100
no synchronization
bgp log-neighbor-changes
network 1.1.1.1 mask 255.255.255.255
network 1.2.2.2 mask 255.255.255.255
network 1.3.3.3 mask 255.255.255.255
network 1.4.4.4 mask 255.255.255.255
network 1.5.5.5 mask 255.255.255.255
aggregate-address 1.0.0.0 255.0.0.0 summary-only
neighbor 172.12.12.2 remote-as 200
neighbor 172.12.14.4 remote-as 100

The following route shows up on R2:

R2#show ip bgp | begin Network
Network Next Hop Metric LocPrf Weight Path
* 1.0.0.0 172.12.23.3 0 300 100 i
*> 172.12.12.1 0 100 i

As you can see we are supressing all of the 1.0.0.0 subnets. Suppose we wanted to advertise one of the subnets as well, to do so we can use the unsuppress-map option on the neighbor command.

On R1:

R1(config)#access-list 12 permit 1.1.1.1
R1(config)#access-list 12 permit 1.2.2.2
R1(config)#access-list 12 permit 1.3.3.3
R1(config)#route-map ALLOW
R1(config-route-map)#match ip address 12
R1(config-route-map)#exit
R1(config)#router bgp 100
R1(config-router)#neighbor 172.12.12.2 unsuppress-map ALLOW

Clear BGP:

R1#clear ip bgp *
R1#
00:41:47: %BGP-5-ADJCHANGE: neighbor 172.12.12.2 Down User reset
00:42:28: %BGP-5-ADJCHANGE: neighbor 172.12.12.2 Up

Now on R2 we have "unsuppressed" 3 routes:

R2#show ip bgp | inc 1\.
* 1.0.0.0 172.12.23.3 0 300 100 i
*> 1.1.1.1/32 172.12.12.1 0 0 100 i
*> 1.2.2.2/32 172.12.12.1 0 0 100 i
*> 1.3.3.3/32 172.12.12.1 0 0 100 i

4 comments:

  1. This comment has been removed by the author.

    ReplyDelete
  2. This comment has been removed by the author.

    ReplyDelete
  3. Hi There,
    You must be wondering but I am really going through deeply with all of your hard work. And trying to improve my understanding as I am bit lazy in configuring things... But I have start doing it...

    Well I have answer for
    When to use " unsuppress-map" and when to use "suppress-map"

    As we know this both options are used with different commands...
    1. # neighbor ip-add unsuppress-map 'route-map'
    2. # aggregate-add 2.2.0.0 255.255.0.0 suppress-map

    2. Option will not only suppress the unwanted routes but also affect the as_path attributes for aggregate route,
    while
    1. Option will un-suppress routes that are suppressed in aggregate-address summary and here ,
    important thing is we have more granularity to apply this to specific neighbor

    while option 2 will affect every neighbor

    ReplyDelete
  4. Great post! thanks for that

    ReplyDelete

Note: Only a member of this blog may post a comment.