Saturday 1 February 2020

BGP Aggregation


Here am going show you how to aggregate the network.
Note I changed the address scheme so that I can aggregate the address.

R4#sh ip route 44.4.0.0 255.255.252.0 longer-prefixes
*Jan  9 00:47:18.382: %SYS-5-CONFIG_I: Configured from console by console
R4#sh ip bgp regexp ^$
BGP table version is 19, local router ID is 150.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
*> 4.1.0.0/24       0.0.0.0                  0         32768 i
*> 4.2.0.0/24       0.0.0.0                  0         32768 i
*> 4.3.0.0/24       0.0.0.0                  0         32768 i
*> 44.4.1.0/24      0.0.0.0                  0         32768 ?
*> 44.4.2.0/24      0.0.0.0                  0         32768 ?
*> 44.4.3.0/24      0.0.0.0                  0         32768 ?

Here am going to aggregate all 44.4.x.x/24 network.
As aggregation we found 44.4.0.0 / 22.

Note: while doing aggregation it should be must that one subnet should be present in the bgp routing table. Then only the advertise aggregation will be propagated.

R4#sh ip route 44.4.0.0 255.255.252.0 longer-prefixes
Codes: C - connected, S - static, R - RIP, M - mobile, B - BGP
       D - EIGRP, EX - EIGRP external, O - OSPF, IA - OSPF inter area
       N1 - OSPF NSSA external type 1, N2 - OSPF NSSA external type 2
       E1 - OSPF external type 1, E2 - OSPF external type 2
       i - IS-IS, su - IS-IS summary, L1 - IS-IS level-1, L2 - IS-IS level-2
       ia - IS-IS inter area, * - candidate default, U - per-user static route
       o - ODR, P - periodic downloaded static route

Gateway of last resort is not set

     44.0.0.0/24 is subnetted, 3 subnets
C       44.4.1.0 is directly connected, Loopback11
C       44.4.2.0 is directly connected, Loopback12
C       44.4.3.0 is directly connected, Loopback13

So this is my valid aggregate address. Hence lets configure the aggregate address.

R4(config)#router bgp 400
R4(config-router)#aggregate-address 44.4.0.0 255.255.252.0

R4#sh ip bgp regexp ^$
BGP table version is 20, local router ID is 150.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
*> 4.1.0.0/24       0.0.0.0                  0         32768 i
*> 4.2.0.0/24       0.0.0.0                  0         32768 i
*> 4.3.0.0/24       0.0.0.0                  0         32768 i
*> 44.4.0.0/22      0.0.0.0                            32768 i
*> 44.4.1.0/24      0.0.0.0                  0         32768 ?
*> 44.4.2.0/24      0.0.0.0                  0         32768 ?
*> 44.4.3.0/24      0.0.0.0                  0         32768 ?

R4#sh ip bgp 44.4.0.0/22
BGP routing table entry for 44.4.0.0/22, version 20
Paths: (1 available, best #1, table Default-IP-Routing-Table)
  Advertised to update-groups:
     1
  Local, (aggregated by 400 150.4.4.4)
    0.0.0.0 from 0.0.0.0 (150.4.4.4)
      Origin IGP, localpref 100, weight 32768, valid, aggregated, local, atomic-aggregate, best

This information gives us the details about the who is aggregate this prefixes. This will be helpful when the R4 again receive its own aggregate address it will not consider that update by seeing this value.
Now lets check on R6 and try to reach this prefix form R6.

R6#sh ip bgp 44.4.0.0/22
BGP routing table entry for 44.4.0.0/22, version 110
Paths: (1 available, best #1, table Default-IP-Routing-Table)
  Not advertised to any peer
  100 400, (aggregated by 400 150.4.4.4)
    155.1.16.1 from 155.1.16.1 (150.1.1.1)
      Origin IGP, localpref 100, valid, external, atomic-aggregate, best
R6#sh ip bgp | in 44.4
*> 44.4.0.0/22      155.1.16.1                             0 100 400 i
*> 44.4.1.0/24      155.1.16.1                             0 100 400 ?
*> 44.4.2.0/24      155.1.16.1                             0 100 400 ?
*> 44.4.3.0/24      155.1.16.1                             0 100 400 ?

See we got all the updates including the aggregate address.

Summary only command is used to advertise only the summary address.

R4#sh run | s router bgp
router bgp 400
 no synchronization
 bgp log-neighbor-changes
 network 4.1.0.0 mask 255.255.255.0
 network 4.2.0.0 mask 255.255.255.0
 network 4.3.0.0 mask 255.255.255.0
 aggregate-address 44.4.0.0 255.255.252.0 summary-only
 redistribute eigrp 1 route-map 44_network
 neighbor 150.5.5.5 remote-as 500
 neighbor 150.5.5.5 ttl-security hops 2
 neighbor 150.5.5.5 update-source Loopback0
 neighbor 155.1.34.3 remote-as 100
 no auto-summary


R4#sh ip bgp regexp ^$
BGP table version is 25, local router ID is 150.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
*> 4.1.0.0/24       0.0.0.0                  0         32768 i
*> 4.2.0.0/24       0.0.0.0                  0         32768 i
*> 4.3.0.0/24       0.0.0.0                  0         32768 i
*> 44.4.0.0/22      0.0.0.0                            32768 i
s> 44.4.1.0/24      0.0.0.0                  0         32768 ?
s> 44.4.2.0/24      0.0.0.0                  0         32768 ?
s> 44.4.3.0/24      0.0.0.0                  0         32768 ?

Note this s indicates suppressed. So lets check on R6 router.

R6#sh ip bgp | in 44.4
*> 44.4.0.0/22      155.1.16.1                             0 100 400 I

R6#traceroute 44.4.1.4 source loopback 1

Type escape sequence to abort.
Tracing the route to 44.4.1.4

  1 155.1.16.1 4 msec 84 msec 48 msec
  2 155.1.123.3 200 msec 244 msec 124 msec
  3 155.1.34.4 208 msec *  152 msec

Note the summary only command effect all the peer internal and external peers.

Now lets do more interesting with aggregation

R1#sh ip bgp ne 150.3.3.3 advertised-routes
BGP table version is 121, local router ID is 150.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
*> 6.1.0.0/16       155.1.16.6               0             0 600 i
*> 6.2.0.0/16       155.1.16.6               0             0 600 i
*> 6.3.0.0/16       155.1.16.6               0             0 600 i
*> 150.1.1.0/24     0.0.0.0                  0         32768 i
*> 150.2.2.0/24     155.1.123.2              2         32768 i
*> 150.3.3.0/24     155.1.123.3              2         32768 i

Total number of prefixes 6

R1#sh ip bgp ne 150.2.2.2 advertised-routes
BGP table version is 121, local router ID is 150.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
*> 6.1.0.0/16       155.1.16.6               0             0 600 i
*> 6.2.0.0/16       155.1.16.6               0             0 600 i
*> 6.3.0.0/16       155.1.16.6               0             0 600 i
*> 150.1.1.0/24     0.0.0.0                  0         32768 i
*> 150.2.2.0/24     155.1.123.2              2         32768 i
*> 150.3.3.0/24     155.1.123.3              2         32768 i

Total number of prefixes 6

So here R1 sending updates to R2 and R3 about 6.x.x.x/16 and 150.x.x.x/24 network. Here what am going to do is one neighbor going to get only the aggregate route and another neighbor will get the another aggregate routes.

So R1 going to aggregate 6.x.x.x/16 network to R2 and 150.x.x.x/24 network to R3.

No comments:

Post a Comment