Saturday 1 February 2020

BGP Confederation


Here am going to create sub AS this will eliminate the need of full mesh iBGP peer within the AS.

R1#sh run | s router bgp
router bgp 6500
 no synchronization
 bgp log-neighbor-changes
 bgp confederation identifier 100
 bgp confederation peers 65412
 neighbor 150.2.2.2 remote-as 65412
 neighbor 150.2.2.2 ebgp-multihop 2
 neighbor 150.2.2.2 update-source Loopback0
 neighbor 155.1.16.6 remote-as 600
 no auto-summary

R2#sh run | s router bgp
router bgp 65412
 no synchronization
 bgp log-neighbor-changes
 bgp confederation identifier 100
 bgp confederation peers 6500
 neighbor 150.1.1.1 remote-as 6500
 neighbor 150.1.1.1 ebgp-multihop 2
 neighbor 150.1.1.1 update-source Loopback0
 neighbor 150.3.3.3 remote-as 65412
 neighbor 150.3.3.3 update-source Loopback0
 no auto-summary

R3#sh run | s router bgp
router bgp 65412
 no synchronization
 bgp log-neighbor-changes
 bgp confederation identifier 100
 neighbor 150.2.2.2 remote-as 65412
 neighbor 150.2.2.2 update-source Loopback0
 neighbor 155.1.34.4 remote-as 400
 neighbor 155.1.35.5 remote-as 500
 no auto-summary

What's the use of confederation?? Lets look at prefixes advertisement.
As we knew R5 advertising the  prefixes to R3 and R3 will be advertise to R2 , and since R2 and R1 is eBGP peer we don’t need to modify the  Route reflector. R2 will automatically advertise to R1. So lets have a look on R2 bgp updates.


R3#sh ip bgp
BGP table version is 10, local router ID is 150.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
*> 4.1.0.0/24       155.1.34.4               0             0 400 i
*> 4.2.0.0/24       155.1.34.4               0             0 400 i
*> 4.3.0.0/24       155.1.34.4               0             0 400 i
*> 5.1.0.0/24       155.1.35.5               0             0 500 i
*> 5.2.0.0/24       155.1.35.5               0             0 500 i
*> 5.3.0.0/24       155.1.35.5               0             0 500 i
*>i6.1.0.0/16       155.1.16.6               0    100      0 (6500) 600 i
*>i6.2.0.0/16       155.1.16.6               0    100      0 (6500) 600 i
*>i6.3.0.0/16       155.1.16.6               0    100      0 (6500) 600 i

R3 getting the prefixes from R5 with a next hop 155.1.35.5. Since R3 and R2 is an iBGP peer R3 will send the update to R2 but R3 will not change the next hop.

R2#sh ip bgp
BGP table version is 4, local router ID is 150.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
* i4.1.0.0/24       155.1.34.4               0    100      0 400 i
* i4.2.0.0/24       155.1.34.4               0    100      0 400 i
* i4.3.0.0/24       155.1.34.4               0    100      0 400 i
* i5.1.0.0/24       155.1.35.5               0    100      0 500 i
* i5.2.0.0/24       155.1.35.5               0    100      0 500 i
* i5.3.0.0/24       155.1.35.5               0    100      0 500 i
*> 6.1.0.0/16       155.1.16.6               0    100      0 (6500) 600 i
*> 6.2.0.0/16       155.1.16.6               0    100      0 (6500) 600 i
*> 6.3.0.0/16       155.1.16.6               0    100      0 (6500) 600 i

R2 didn’t mark this prefixes as the best and valid routes. Since we don’t have the reachability to the next hop. Lets simply tell the R3 to do next hop modification.

R3(config)#router bgp 65412
R3(config-router)#neighbor 150.2.2.2 next-hop-self

R2#sh ip bgp
BGP table version is 10, local router ID is 150.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
*>i4.1.0.0/24       150.3.3.3                0    100      0 400 i
*>i4.2.0.0/24       150.3.3.3                0    100      0 400 i
*>i4.3.0.0/24       150.3.3.3                0    100      0 400 i
*>i5.1.0.0/24       150.3.3.3                0    100      0 500 i
*>i5.2.0.0/24       150.3.3.3                0    100      0 500 i
*>i5.3.0.0/24       150.3.3.3                0    100      0 500 i
*> 6.1.0.0/16       155.1.16.6               0    100      0 (6500) 600 i
*> 6.2.0.0/16       155.1.16.6               0    100      0 (6500) 600 i
*> 6.3.0.0/16       155.1.16.6               0    100      0 (6500) 600 i

See all the prefixes marked as best and valid routes.  Now R2 will update these prefixes to R1 because they are in eBGP peer. So lets have a look on R1 .
R1#sh ip bgp
BGP table version is 10, 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
*> 4.1.0.0/24       150.3.3.3                0    100      0 (65412) 400 i
*> 4.2.0.0/24       150.3.3.3                0    100      0 (65412) 400 i
*> 4.3.0.0/24       150.3.3.3                0    100      0 (65412) 400 i
*> 5.1.0.0/24       150.3.3.3                0    100      0 (65412) 500 i
*> 5.2.0.0/24       150.3.3.3                0    100      0 (65412) 500 i
*> 5.3.0.0/24       150.3.3.3                0    100      0 (65412) 500 i
*> 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

Note R1 getting the prefixes but have a deep look on the prefixes, the prefixes comes with the sub AS value  prepended. The Sub AS will be denoted in bracket (65412).  So let have look on the last router R6.

R6#sh ip bgp
BGP table version is 36, local router ID is 150.6.6.6
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       155.1.16.1                             0 100 400 i
*> 4.2.0.0/24       155.1.16.1                             0 100 400 i
*> 4.3.0.0/24       155.1.16.1                             0 100 400 i
*> 5.1.0.0/24       155.1.16.1                             0 100 500 i
*> 5.2.0.0/24       155.1.16.1                             0 100 500 i
*> 5.3.0.0/24       155.1.16.1                             0 100 500 i
*> 6.1.0.0/16       0.0.0.0                  0         32768 i
*> 6.2.0.0/16       0.0.0.0                  0         32768 i
*> 6.3.0.0/16       0.0.0.0                  0         32768 i

Did u noted one interesting thing the Sub AS is removed as it come out the sub AS into normal/main AS.


No comments:

Post a Comment