Image of Cortney & Jeremy

BGP Route Reflectors

by Jeremy L. Gaddis on March 8, 2010 · 10 comments

in Networking

Hopefully you recall that when running iBGP, a full mesh is required between all iBGP speaking peers within an autonomous system (AS). This can quickly lead to a huge number of peerings — and the associated management overhead — as we add more iBGP speakers. The total number of peerings needed to satisfy the full mesh requirement is illustrated by the following formula, where “n” is the number of iBGP speakers:

   n(n-1)/2

Thus:

  • 5 routers = 10 peerings
  • 10 routers = 45 peerings
  • 25 routers = 600 peerings

Would you want to manage all that? Me either. Enter route reflectors.

Route reflectors are one solution for keeping all of this under control. Route reflectors ease the full-mesh limitation and allows one router to advertise, or reflect, iBGP learned routes to other iBGP speakers. This has the end result of reducing the number of iBGP peers within our AS.

Here’s the topology we’ll be working with:

In this scenario, we’ll be running OSPF as our IGP and all routers will run iBGP and are members of AS 65000. R3 will serve as our route reflector, and all other routers only need to establish a BGP peering with R3. On R1 and R2 we’ll advertised the networks represented by the loopback0 interfaces as well.

Let’s get basic connectivity established.

R1# configure terminal
R1(config)# interface serial 0/1
R1(config-if)# ip address 198.18.13.1 255.255.255.0
R1(config-if)# no shutdown
R2# configure terminal
R2(config)# interface serial 0/1
R2(config-if)# ip address 198.18.23.2 255.255.255.0
R2(config-if)# no shutdown
R3# configure terminal
R3(config)# interface serial 1/2
R3(config-if)# clock rate 128000
R3(config-if)# ip address 198.18.13.3 255.255.255.0
R3(config-if)# no shutdown
R3(config-if)# interface serial 1/3
R3(config-if)# clock rate 128000
R3(config-if)# ip address 198.18.23.3 255.255.255.0
R3(config-if)# no shutdown
R3(config-if)# interface serial 1/0
R3(config-if)# encapsulation frame-relay
R3(config-if)# no shutdown
R3(config-if)# interface serial 1/0.34 point-to-point
R3(config-subif)# frame-relay interface-dlci 304
R3(config-fr-dlci)# ip address 198.18.34.3 255.255.255.0
R3(config-subif)# interface serial 1/0.35 point-to-point
R3(config-subif)# frame-relay interface-dlci 305
R3(config-fr-dlci)# ip address 198.18.35.3 255.255.255.0
R4# configure terminal
R4(config)# interface serial 0/0
R4(config-if)# encapsulation frame-relay
R4(config-if)# no shutdown
R4(config-if)# interface serial 0/0.34 point-to-point
R4(config-subif)# frame-relay interface-dlci 403
R4(config-fr-dlci)# ip address 198.18.34.4 255.255.255.0
R5# configure terminal
R5(config)# interface serial 0/0
R5(config-if)# encapsulation frame-relay
R5(config-if)# no shutdown
R5(config-if)# interface serial 0/0.35 point-to-point
R5(config-subif)# frame-relay interface-dlci 503
R5(config-fr-dlci)# ip address 198.18.35.5 255.255.255.0

At this point, make sure you can ping all routers from R3 and vice versa.

Go ahead and configure the loopback interfaces on R1 and R2.

R1(config-if)# interface loopback 0
R1(config-if)# ip address 198.18.111.1 255.255.255.255
R2(config-if)# interface loopback 0
R2(config-if)# ip address 198.18.222.2 255.255.255.255

Let’s configure our IGP, OSPF. We’ll keep it simple since our focus is on BGP. On R3, R4, and R5 configure OSPF process ID 1 and advertise all networks, e.g.:

! on R3, R4, and R5
router ospf 1
 network 0.0.0.0 255.255.255.255 area 0

On R1 and R2, we’ll just run OSPF on the links to R3 (we’re “saving” our loopbacks for BGP).

R1(config-if)# router ospf 1
R1(config-router)# network 198.18.13.1 0.0.0.0 area 0
R2(config-if)# router ospf 1
R2(config-router)# network 198.18.23.2 0.0.0.0 area 0

Make sure you’re seeing all advertised routes on all routers.

When it comes to configuring BGP, the only place we have to do anything different is on the route reflector itself. Let’s go ahead and configure R1, R2, R4, and R5 for a BGP peering to R3. On R1 and R2, we’ll advertise the IP addresses of the loopback 0 interfaces into BGP as well.

R1(config-router)# router bgp 65000
R1(config-router)# neighbor 198.18.13.3 remote-as 65000
R1(config-router)# network 198.18.111.1 mask 255.255.255.255
R2(config-router)# router bgp 65000
R2(config-router)# neighbor 198.18.23.3 remote-as 65000
R2(config-router)# network 198.18.222.2 mask 255.255.255.255
R4(config-router)# router bgp 65000
R4(config-router)# neighbor 198.18.34.3 remote-as 65000
R5(config-router)# router bgp 65000
R5(config-router)# neighbor 198.18.35.3 remote-as 65000

Next, we simply have to configure BGP on R3. We’ll use the “route-reflector-client” option to the “neighbor” command to let R3 know that the other routers should be considered as route reflector clients (intuitive, huh!?). In this case, R3 will “reflect” advertisements from one client to the others. Hence, the advertisements from R1 and R2 (for their loopback 0 interfaces) will be reflected to the other routers. We’ll be able to verify this by looking at the BGP tables on R4 and R5.

R3(config-router)# router bgp 65000
R3(config-router)# neighbor 198.18.13.1 remote-as 65000
R3(config-router)# neighbor 198.18.13.1 route-reflector-client
R3(config-router)# neighbor 198.18.23.2 remote-as 65000
R3(config-router)# neighbor 198.18.23.2 route-reflector-client
R3(config-router)# neighbor 198.18.34.4 remote-as 65000
R3(config-router)# neighbor 198.18.34.4 route-reflector-client
R3(config-router)# neighbor 198.18.35.5 remote-as 65000
R3(config-router)# neighbor 198.18.35.5 route-reflector-client

Wait a moment for all the BGP sessions to come up (remember, BGP is sloooooow) then take a look at the BGP tables on R4 and R5.

R4(config-router)# do show ip bgp | begin Network
   Network          Next Hop            Metric LocPrf Weight Path
*>i198.18.111.1/32  198.18.13.1              0    100      0 i
*>i198.18.222.2/32  198.18.23.2              0    100      0 i
R5(config-router)# do show ip bgp | begin Network
   Network          Next Hop            Metric LocPrf Weight Path
*>i198.18.111.1/32  198.18.13.1              0    100      0 i
*>i198.18.222.2/32  198.18.23.2              0    100      0 i

That’s all there is to it! We’ve taken what normally would take a total of 10 BGP sessions and accomplished the same thing with just four. Later, we’ll talk about BGP confederations, another technique for reducing the iBGP mesh (mess).

{ 10 comments… read them below or add one }

Leave a Comment

Previous post:

Next post: