In this post I will explane BGP route reflectors. We will be using the following network digram for this post.
Just like all routing protocols BGP has its own loop prevention mechanism. One of these mechanisms is the split horizon rule. The Split horizon rule for routing protocols is “don’t send updates back on the interface you have received them on”. With BGP this is a little different. If you received a route update from an iBGP peer you do not forward this to any other iBGP peer. Therefor you will need to have a full mesh network for the entire iBGP router to get the update. One of the ways to solve this problem is using BGP route reflectors. The Route reflector (R3 in our example) reflects routes to all its clients (R5 and R6) when it gets in update from an iBGP neighbour. When it gets in update from an client it forwards this update to all clients and non-clients (including eBGP neighbours).
To begin with all the iBGP router (R2, R3, R4, R5 and R6) are all configured with IP address and a loopback interface that represents the routers number. So for example R2 will have a loopback address 18.104.22.168 ect. We will be focusing on the configuration on R3 as this is our Route Reflector.
interface Loopback1 ip address 22.214.171.124 255.255.255.0 ! interface FastEthernet0/0 ip address 192.168.32.3 255.255.255.0 ! interface Serial0/0 ip address 192.168.34.3 255.255.255.0 ! interface FastEthernet0/1 ip address 192.168.37.3 255.255.255.0 ! interface Serial0/1 ip address 192.168.35.3 255.255.255.0 ! interface Serial0/2 ip address 192.168.36.3 255.255.255.0 !
Each address range is set according to the router its connected to. For example serial 0/2 has the ip address of 192.168.36.x where the 36 is represents the connection from router 3 to router 6. Now we need to configure OSPF for the internal peers.
! router ospf 1 router-id 126.96.36.199 network 188.8.131.52 0.0.0.0 area 0 network 192.168.0.0 0.0.255.255 area 0 !
Now we are running OSPF between all the peers we can now set up BGP. To make the configuration easy I have used peer groups for router R5 and R6. Peer groups is simple a group that has configuration on it and can be applied to multiple neighbours to save typing the same thing again.
! router bgp 100 neighbor PGROUP peer-group neighbor PGROUP remote-as 100 neighbor PGROUP update-source Loopback1 neighbor PGROUP route-reflector-client neighbor 184.108.40.206 peer-group PGROUP neighbor 220.127.116.11 peer-group PGROUP !
The above would put all the peers with the commands listed above. Now we can configure the non-clients.
! router bgp 100 neighbor 18.104.22.168 remote-as 100 neighbor 22.214.171.124 update-source Loopback1 neighbor 126.96.36.199 remote-as 100 neighbor 188.8.131.52 update-source Loopback1 neighbor 192.168.37.7 remote-as 400 !
Now we should have 5 neighbour relationships from all the router connected to R3 (4 internal and 1 external). We now need to check our neighbours.
We can see (using the “show ip bgp summary” command) that we have 5 neighbours. I have also set the neighbour relationship from R1 and R2 and created multiple loopbacks and put that part of the bgp process.
! interface Loopback1 ip address 184.108.40.206 255.255.255.0 ! interface Loopback2 ip address 220.127.116.11 255.255.255.0 ! interface Loopback3 ip address 18.104.22.168 255.255.255.0 ! interface Loopback4 ip address 22.214.171.124 255.255.255.0 ! interface Loopback5 ip address 126.96.36.199 255.255.255.0 ! interface Loopback6 ip address 188.8.131.52 255.255.255.0 ! interface FastEthernet0/0 ip address 192.168.23.3 255.255.255.0 ! router bgp 200 network 184.108.40.206 mask 255.255.255.0 network 220.127.116.11 mask 255.255.255.0 network 18.104.22.168 mask 255.255.255.0 network 22.214.171.124 mask 255.255.255.0 redistribute connected route-map S-ROUTES neighbor 192.168.23.2 remote-as 100 ! ip access-list extended ROUTES permit ip host 126.96.36.199 host 255.255.255.0 permit ip host 188.8.131.52 host 255.255.255.0 ! route-map S-ROUTES permit 10 match ip address ROUTES !
I have redistributed some routes so we can see the difference in the BGP routing table for networks that are redistributed and networks that are added using the network command. On R4 and on R6 I added 1 route to the BGP process using a route-map as seen below.
! router bgp 100 redistribute connected route-map R4-CON ! ip access-list extended R4 permit ip host 192.168.34.0 host 255.255.255.0 ! route-map R4-CON permit 10 match ip address R4 !
! router bgp 100 network 192.168.36.0 route-map R6-RD ! ip access-list extended R6 permit ip host 192.168.36.0 host 255.255.255.0 ! route-map R6-RD permit 10 set origin igp route-map R6-RD permit 20 !
Now its time to check if the route reflector is working or now. Are R6 is a client it should have all the routes the R3 has learnt that are the best routes in the BGP table. As R4 is not a client it would not have these routes.
We can see that all the routes we got from R1 are in R6’s routing table. Also the route we got from R4 is alos in the routing table. On R4 the only route we have is the one from R6. If we remember how Route Reflectors work we know when R3 gets a route from a client it goes to all Clients and Non-Clients. Therefor we have the Route we got from R6 on R4 as well. We can also see the difference bewteen routes that have been added using the network command (i) and routes that have been redistributed(?).
Now lets see how externel neighbours are effected.
As the BGP split horizon rule does not apply to external neighbours R3 should send routes to R7 as normal. We can see from the above that the external neighbour has got all the routes we would expect.
We have successfully set up BGP route reflectors.