Saturday, 16 June 2012

BGP: Route Aggregation:

BGP: Route Aggregation:

Let me take a small scenario to configure this:


·         R1: AS 100
·         R2: AS 200
·         R3: AS 300
·         R4: AS 400
·         R5: AS 500

·         R2 is advertising 23.1.1.2 and 23.1.2.2 into its BGP
·         R3 is advertising 23.1.3.3 and 23.1.4.3 into its BGP

Let me see the BGP Configs before doing route aggregation

R1(config-router)#do show run | begin router bgp
router bgp 100
 no synchronization
 bgp router-id 1.1.1.1
 bgp log-neighbor-changes
 neighbor 10.1.12.2 remote-as 200
 neighbor 10.1.13.3 remote-as 300
 neighbor 10.1.14.4 remote-as 400
 neighbor 10.1.15.5 remote-as 500
 no auto-summary
!

R2(config-router)#do show run | begin router bgp
router bgp 200
 no synchronization
 bgp router-id 2.2.2.2
 bgp log-neighbor-changes
 network 23.1.1.0 mask 255.255.255.0
 network 23.1.2.0 mask 255.255.255.0
 neighbor 10.1.12.1 remote-as 100
 no auto-summary
!

R3(config-router)#do show run | begin router bgp
router bgp 300
 no synchronization
 bgp router-id 3.3.3.3
 bgp log-neighbor-changes
 network 23.1.3.0 mask 255.255.255.0
 network 23.1.4.0 mask 255.255.255.0
 neighbor 10.1.13.1 remote-as 100
 no auto-summary
!

R4(config-router)#do show run | begin router bgp
router bgp 400
 no synchronization
 bgp router-id 4.4.4.4
 bgp log-neighbor-changes
 neighbor 10.1.14.1 remote-as 100
 no auto-summary
!

R5(config-router)#do show run | begin router bgp
router bgp 500
 no synchronization
 bgp router-id 5.5.5.5
 bgp log-neighbor-changes
 neighbor 10.1.15.1 remote-as 100
 no auto-summary
!

R2(config-router)#do show ip bgp
BGP table version is 11, 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
*> 23.1.1.0/24      0.0.0.0                  0         32768 i
*> 23.1.2.0/24      0.0.0.0                  0         32768 i
*> 23.1.3.0/24      10.1.12.1                              0 100 300 i
*> 23.1.4.0/24      10.1.12.1                              0 100 300 i
R2(config-router)#

R3(config-router)#do show ip bgp
BGP table version is 11, local router ID is 3.3.3.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
*> 23.1.1.0/24      10.1.13.1                              0 100 200 i
*> 23.1.2.0/24      10.1.13.1                              0 100 200 i
*> 23.1.3.0/24      0.0.0.0                  0         32768 i
*> 23.1.4.0/24      0.0.0.0                  0         32768 i
R3(config-router)#

R1(config-router)#do show ip bgp
BGP table version is 15, local router ID is 1.1.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
*> 23.1.1.0/24      10.1.12.2                0             0 200 i
*> 23.1.2.0/24      10.1.12.2                0             0 200 i
*> 23.1.3.0/24      10.1.13.3                0             0 300 i
*> 23.1.4.0/24      10.1.13.3                0             0 300 i
R1(config-router)#

R4(config-router)#do show ip bgp
BGP table version is 15, local router ID is 4.4.4.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
*> 23.1.1.0/24      10.1.14.1                              0 100 200 i
*> 23.1.2.0/24      10.1.14.1                              0 100 200 i
*> 23.1.3.0/24      10.1.14.1                              0 100 300 i
*> 23.1.4.0/24      10.1.14.1                              0 100 300 i
R4(config-router)#

R5(config-router)#do show ip bgp
BGP table version is 15, local router ID is 5.5.5.5
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
*> 23.1.1.0/24      10.1.15.1                              0 100 200 i
*> 23.1.2.0/24      10.1.15.1                              0 100 200 i
*> 23.1.3.0/24      10.1.15.1                              0 100 300 i
*> 23.1.4.0/24      10.1.15.1                              0 100 300 i
R5(config-router)#

Observations:

·         All BGP neighbors are Up
·         All routers received the 4 prefixes advertised by R2 and R3

Now, let me configure route aggregation in R1:

R1(config-router)#aggregate-address 23.1.0.0 255.255.0.0


R1(config-router)#do show ip bgp
BGP table version is 16, local router ID is 1.1.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
*> 23.1.0.0/16      0.0.0.0                            32768 i
*> 23.1.1.0/24      10.1.12.2                0             0 200 i
*> 23.1.2.0/24      10.1.12.2                0             0 200 i
*> 23.1.3.0/24      10.1.13.3                0             0 300 i
*> 23.1.4.0/24      10.1.13.3                0             0 300 i
R1(config-router)#

R4(config-router)#do show ip bgp
BGP table version is 16, local router ID is 4.4.4.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
*> 23.1.0.0/16      10.1.14.1                0             0 100 i
*> 23.1.1.0/24      10.1.14.1                              0 100 200 i
*> 23.1.2.0/24      10.1.14.1                              0 100 200 i
*> 23.1.3.0/24      10.1.14.1                              0 100 300 i
*> 23.1.4.0/24      10.1.14.1                              0 100 300 i
R4(config-router)#

R5(config-router)#do show ip bgp
BGP table version is 16, local router ID is 5.5.5.5
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
*> 23.1.0.0/16      10.1.15.1                0             0 100 i
*> 23.1.1.0/24      10.1.15.1                              0 100 200 i
*> 23.1.2.0/24      10.1.15.1                              0 100 200 i
*> 23.1.3.0/24      10.1.15.1                              0 100 300 i
*> 23.1.4.0/24      10.1.15.1                              0 100 300 i
R5(config-router)#

R2(config-router)#do show ip bgp
BGP table version is 12, 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
*> 23.1.0.0/16      10.1.12.1                0             0 100 i
*> 23.1.1.0/24      0.0.0.0                  0         32768 i
*> 23.1.2.0/24      0.0.0.0                  0         32768 i
*> 23.1.3.0/24      10.1.12.1                              0 100 300 i
*> 23.1.4.0/24      10.1.12.1                              0 100 300 i
R2(config-router)#

R3(config-router)#do show ip bgp
BGP table version is 12, local router ID is 3.3.3.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
*> 23.1.0.0/16      10.1.13.1                0             0 100 i
*> 23.1.1.0/24      10.1.13.1                              0 100 200 i
*> 23.1.2.0/24      10.1.13.1                              0 100 200 i
*> 23.1.3.0/24      0.0.0.0                  0         32768 i
*> 23.1.4.0/24      0.0.0.0                  0         32768 i
R3(config-router)#

Observations:

·         Aggregated route has been updated to all other neighbors
·         But surprisingly still the individual routes appear in the BGP Table (This doesn’t happen in IGP, only Summarized routes will be advertised)
·         But don’t worry; we have more granular control in BGP advertising than in regular BGP

Let me configure summary-only key-word:

R1(config-router)#aggregate-address 23.1.0.0 255.255.0.0 summary-only

R1(config-router)#do show ip bgp
BGP table version is 20, local router ID is 1.1.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
*> 23.1.0.0/16      0.0.0.0                            32768 i
s> 23.1.1.0/24      10.1.12.2                0             0 200 i
s> 23.1.2.0/24      10.1.12.2                0             0 200 i
s> 23.1.3.0/24      10.1.13.3                0             0 300 i
s> 23.1.4.0/24      10.1.13.3                0             0 300 i
R1(config-router)#

R4(config-router)#do show ip bgp
BGP table version is 20, local router ID is 4.4.4.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
*> 23.1.0.0/16      10.1.14.1                0             0 100 i
R4(config-router)#

R5(config-router)#do show ip bgp
BGP table version is 20, local router ID is 5.5.5.5
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
*> 23.1.0.0/16      10.1.15.1                0             0 100 i
R5(config-router)#

R2(config-router)#do show ip bgp
BGP table version is 14, 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
*> 23.1.0.0/16      10.1.12.1                0             0 100 i
*> 23.1.1.0/24      0.0.0.0                  0         32768 i
*> 23.1.2.0/24      0.0.0.0                  0         32768 i
R2(config-router)#

R3(config-router)#do show ip bgp
BGP table version is 14, local router ID is 3.3.3.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
*> 23.1.0.0/16      10.1.13.1                0             0 100 i
*> 23.1.3.0/24      0.0.0.0                  0         32768 i
*> 23.1.4.0/24      0.0.0.0                  0         32768 i
R3(config-router)#

Observations:

·         Only summary-address has been advertised to neighbors from R1
·         Individual-routes are suppressed

·         Though we see the summarized route on R4 and R5, it shows the AS-PATH as 100, it doesn’t show about 200 and 300?????
·         For this, we need to add AS-SET key-word
·         Let me configure AS-SET and see what happens:

R1(config-router)#aggregate-address 23.1.0.0 255.255.0.0 summary-only as-set
R1(config-router)#

R1(config-router)#do show ip bgp
BGP table version is 21, local router ID is 1.1.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
*> 23.1.0.0/16      0.0.0.0                       100  32768 {200,300} i
s> 23.1.1.0/24      10.1.12.2                0             0 200 i
s> 23.1.2.0/24      10.1.12.2                0             0 200 i
s> 23.1.3.0/24      10.1.13.3                0             0 300 i
s> 23.1.4.0/24      10.1.13.3                0             0 300 i
R1(config-router)#

R4(config-router)#do show ip bgp
BGP table version is 21, local router ID is 4.4.4.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
*> 23.1.0.0/16      10.1.14.1                0             0 100 {200,300} i
R4(config-router)#

R5(config-router)#do show ip bgp
BGP table version is 21, local router ID is 5.5.5.5
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
*> 23.1.0.0/16      10.1.15.1                0             0 100 {200,300} i
R5(config-router)#

R2(config-router)#do show ip bgp
BGP table version is 15, 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
*> 23.1.1.0/24      0.0.0.0                  0         32768 i
*> 23.1.2.0/24      0.0.0.0                  0         32768 i
R2(config-router)#

R3(config-router)#do show ip bgp
BGP table version is 15, local router ID is 3.3.3.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
*> 23.1.3.0/24      0.0.0.0                  0         32768 i
*> 23.1.4.0/24      0.0.0.0                  0         32768 i
R3(config-router)#

Observations:

·         Wow, now I see AS 200 and 300 has been added to the AS-PATH list but in the braces
·         This is again used to prevent the loops; down the lane if AS 200 and AS 300 gets this summary-route, they don’t install this route, to avoid the duplication/loop etc.
·         For this reason, we don’t see the summary-route in R2 and R3 after AS-SET command


1 comment: