Thursday, April 28, 2011

Forming the Aggregate based on a Subset of Specific Prefixes

Controlling the individual prefixes that form the aggregate is very useful in determining which attributes the aggregate will carry.
In the previous article, if we could exclude the 192.168.1.0/24 prefix from being part of the prefixes that form the aggregate, the aggregate would not inherit the no-export community attribute.

The advertise map is another form of route maps that determines the formation of the aggregate based on a limited selection of the more-specific prefixes.


Below shows the BGP tables on RT1 and RT2 prior to implementing any aggregation configuration on RT3.
RT1#sh ip bgp
BGP table version is 3, local router ID is 192.168.1.1
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
*> 192.168.1.0      0.0.0.0                  0         32768 i
*> 192.168.2.0      13.13.13.3                             0 300 200 i
RT1#
================================================================================
RT2#sh ip bgp
BGP table version is 3, local router ID is 192.168.2.1
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
*> 192.168.1.0      24.24.24.4                             0 300 100 i
*> 192.168.2.0      0.0.0.0                  0         32768 i
RT2#

Below shows that upon implementing an AS_SET aggregation 192.168.0.0/16 on RT3, RT1 and RT2 denied the aggregate as it contains {100 200} in the AS path, a normal BGP behavior in detecting loops.
RT3#conf t
Enter configuration commands, one per line.  End with CNTL/Z.
RT3(config)#router bgp 300
RT3(config-router)#aggregate-address 192.168.0.0 255.255.0.0 as-set
RT3(config-router)#end
RT3#
RT3#sh ip bgp
BGP table version is 4, local router ID is 34.34.34.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
*> 192.168.0.0/16   0.0.0.0                       100  32768 {100,200} i
*> 192.168.1.0      13.13.13.1               0             0 100 i
*>i192.168.2.0      34.34.34.4               0    100      0 200 i
RT3#
================================================================================
RT4#sh ip bgp
BGP table version is 4, local router ID is 34.34.34.4
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
*>i192.168.0.0/16   34.34.34.3               0    100      0 {100,200} i
*>i192.168.1.0      34.34.34.3               0    100      0 100 i
*> 192.168.2.0      24.24.24.2               0             0 200 i
RT4#
RT1#debug ip bgp updates
BGP updates debugging is on
RT1#
00:01:40: BGP(0): 13.13.13.3 computing updates, afi 0, neighbor version 2, table version 3, starting at 0.0.0.0
00:01:40: BGP(0): 13.13.13.3 update run completed, afi 0, ran for 0ms, neighbor version 2, start version 3, throttled to 3
00:02:06: BGP(0): 13.13.13.3 rcv UPDATE w/ attr: nexthop 13.13.13.3, origin i, metric 0, aggregated by 300 34.34.34.3, originator 0.0.0.0, path 300 {100,200}, community , extended community
00:02:06: BGP(0): 13.13.13.3 rcv UPDATE about 192.168.0.0/16 -- DENIED due to: AS-PATH contains our own AS;
RT1#
================================================================================
RT2#debug ip bgp updates
BGP updates debugging is on
RT2#
00:02:08: BGP(0): 24.24.24.4 rcv UPDATE w/ attr: nexthop 24.24.24.4, origin i, aggregated by 300 34.34.34.3, originator 0.0.0.0, path 300 {100,200}, community , extended community
00:02:08: BGP(0): 24.24.24.4 rcv UPDATE about 192.168.0.0/16 -- DENIED due to: AS-PATH contains our own AS;
RT2#

Below shows how to use an advertise map to cause RT3 to base the aggregate upon 192.168.2.0/24 only, and excludes 192.168.1.0/24 from the formation of the aggregate.
RT3#conf t
Enter configuration commands, one per line.  End with CNTL/Z.
RT3(config)#access-list 1 permit 192.168.2.0 0.0.0.255
RT3(config)#route-map SPEC-ROUTES permit 10
RT3(config-route-map)#match ip address 1
RT3(config-route-map)#exit
RT3(config)#
RT3(config)#router bgp 300
RT3(config-router)#aggregate-address 192.168.0.0 255.255.0.0 as-set advertise-map SPEC-ROUTES
RT3(config-router)#end
RT3#
RT3#sh ip bgp
BGP table version is 5, local router ID is 34.34.34.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
*> 192.168.0.0/16   0.0.0.0                       100  32768 200 i
*> 192.168.1.0      13.13.13.1               0             0 100 i
*>i192.168.2.0      34.34.34.4               0    100      0 200 i
RT3#
================================================================================
RT4#sh ip bgp
BGP table version is 5, local router ID is 34.34.34.4
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
*>i192.168.0.0/16   34.34.34.3               0    100      0 200 i
*>i192.168.1.0      34.34.34.3               0    100      0 100 i
*> 192.168.2.0      24.24.24.2               0             0 200 i
RT4#

RT1 accepted the route as the AS path no longer includes its AS number.
RT1#
00:09:47: BGP(0): 13.13.13.3 rcvd UPDATE w/ attr: nexthop 13.13.13.3, origin i, metric 0, atomic-aggregate, aggregated by 300 34.34.34.3, path 300 200
00:09:47: BGP(0): 13.13.13.3 rcvd 192.168.0.0/16
00:09:47: BGP(0): Revise route installing 1 of 1 route for 192.168.0.0/16 -> 13.13.13.3 to main IP table
00:09:47: BGP(0): 13.13.13.3 computing updates, afi 0, neighbor version 3, table version 4, starting at 0.0.0.0
00:09:47: BGP(0): 13.13.13.3 update run completed, afi 0, ran for 0ms, neighbor version 3, start version 4, throttled to 4
RT1#
RT1#sh ip bgp
BGP table version is 4, local router ID is 192.168.1.1
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
*> 192.168.0.0/16   13.13.13.3               0             0 300 200 i
*> 192.168.1.0      0.0.0.0                  0         32768 i
*> 192.168.2.0      13.13.13.3                             0 300 200 i
RT1#
================================================================================
RT2#
00:09:47: BGP(0): 24.24.24.4 rcv UPDATE w/ attr: nexthop 24.24.24.4, origin i, atomic-aggregate, aggregated by 300 34.34.34.3, originator 0.0.0.0, path 300 200, community , extended community
00:09:47: BGP(0): 24.24.24.4 rcv UPDATE about 192.168.0.0/16 -- DENIED due to: AS-PATH contains our own AS;
RT2#

No comments:

Post a Comment