Course contents

Module 5: Scaling and OperationsLesson 5.8 (8 of 8 in this module)39 of 46 in the BGP course

Lab: replace the iBGP full mesh with a route reflector

The company has added a third internal router, R3, and it needs the ISP routes too. Instead of two more iBGP sessions on every router, you will add one route reflector and watch what it passes on.

Advanced · 20 min read

You'll learn to configure a route reflector and its clients with a peer group, verify the client flag, the originator and the cluster list, and explain what the clients lose when the reflector fails.

The goal

Start from the finished first lab, where R1 and R2 are company routers in AS 64500 with eBGP to ISP A and ISP B. R3 is a new internal router with no BGP at all. By the end, R3 learns the ISP routes through a route reflector named RR, and R1, R2 and R3 are all clients of it.

The loopbacks are already reachable through OSPF, as in the first lab. RR has the router ID 9.9.9.9 and the loopback 10.255.0.9. Every iBGP session in this lab runs between loopbacks, so each router needs a route to the others' loopbacks before any BGP command will work.

Diagram
The route reflector lab: three clients and one reflector
The route reflector lab: three clients and one reflector
The route reflector lab: three clients and one reflectorISP A connects to R1 and ISP B connects to R2 over eBGP. R1, R2 and R3 each have one iBGP session to the route reflector RR, which has the router ID 9.9.9.9 and the loopback 10.255.0.9. R1, R2 and R3 have no sessions with each other.ISP AAS 64501ISP BAS 64502R110.255.0.1R210.255.0.2RR10.255.0.9R310.255.0.3eBGPeBGPiBGP, clientiBGP, clientiBGP, clientNo R1 to R2 sessionRR passes routes on

On small screens, swipe sideways or focus the diagram and use the arrow keys.

Three clients need three sessions, not three pairs. RR passes each client's routes on to the others, so R3 learns the ISP routes without peering with R1 or R2.

What the reflector saves, and what it does not

With three internal routers, the lab is the smallest case that shows the mechanism, and the reflector saves nothing yet: three routers need three sessions in a full mesh, and three clients of one reflector also need three. The saving appears as the network grows, because a full mesh grows with the square of the router count and a reflector grows in step with it.

Diagram
iBGP sessions: full mesh against route reflectors (computed)
iBGP sessions: full mesh against route reflectors (computed)
Internal routersFull meshOne reflectorTwo reflectors
3337
4649
10451021
201902041
501,22550101
Full mesh is n(n-1)/2. One reflector is n sessions, one per client. Two reflectors are 2n plus one session between the reflectors. The counts come from a script.

A reflector also follows its own rule about which routes it passes on. The rule explains why the lab has to remove the direct R1 to R2 session and why R3 receives only one path.

Diagram
What a reflector does with a route (RFC 4456)
What a reflector does with a route (RFC 4456)
The route was learned fromThe reflector sends it to
A clientAll other clients and all non-client iBGP peers
A non-client iBGP peerClients only
An eBGP peerAll clients and all non-client iBGP peers
In this lab every iBGP peer of RR is a client, so a route from one client goes to the other two.

Step 1: look at the starting point

Before you add anything, confirm what R3 knows. This is your baseline, and it shows exactly what the reflector is going to change.

Example output written for this lesson, not a router capture
R3#show ip bgp summary
% BGP not active
R3 does not run BGP yet, so it has no ISP routes and would have no way to leave the company for the Internet.
Diagram
Five steps of this lab
Five steps of this lab

Look, build the reflector, build the clients, verify, then break it.

  1. BaselineR3 has noBGP routes
  2. Reflectorpeer group,client flag
  3. Clientsone sessionto RR each
  4. Verifycluster list,one path
  5. Fail itshut RR,see the loss
Each step has one check. Do not move on until it passes.

Step 2: configure the reflector

Diagram
One reflector, three clients
One reflector, three clients

RR has one iBGP session to each of R1, R2 and R3, all in the same peer group. R1 and R2 are border routers with an ISP each. R3 is internal only.

RR 9.9.9.9
  • R1 client10.255.0.1border, ISP A
  • R2 client10.255.0.2border, ISP B
  • R3 client10.255.0.3internal only
The client flag sits on the group at RR, so the three routers inherit it.

All three clients get the same treatment, so a peer group keeps the configuration short: the settings that are the same go on the group, and each client is added with one line. The flag that makes RR a reflector is route-reflector-client, and it is set on the group, so it applies to every member.

router bgp 64500 bgp router-id 9.9.9.9 neighbor CLIENTS peer-group neighbor CLIENTS remote-as 64500 neighbor CLIENTS update-source Loopback0 neighbor 10.255.0.1 peer-group CLIENTS neighbor 10.255.0.2 peer-group CLIENTS neighbor 10.255.0.3 peer-group CLIENTS address-family ipv4 unicast neighbor CLIENTS route-reflector-client neighbor 10.255.0.1 activate neighbor 10.255.0.2 activate neighbor 10.255.0.3 activate

RR. The three neighbours share remote-as 64500 and the Loopback0 source through the group. route-reflector-client on the group makes every member a client, and each neighbour is activated for IPv4.

Read the commands in order. remote-as 64500 makes the sessions iBGP, because it is the same AS. update-source Loopback0 makes RR send from its loopback, so the clients can peer with 10.255.0.9 even if one physical link fails. The last line is the whole point of the lab.

Step 3: configure the clients

On the clients, nothing says "reflector". Each one has an ordinary iBGP session to RR's loopback. R1 and R2 are the border routers, so they also set next-hop-self: a reflected route keeps its original next hop, and the ISP address would mean nothing to R3. Remove the old direct session between R1 and R2 as well, so the only iBGP path is through RR.

router bgp 64500 no neighbor 10.255.0.2 neighbor 10.255.0.9 remote-as 64500 neighbor 10.255.0.9 update-source Loopback0 address-family ipv4 unicast neighbor 10.255.0.9 activate neighbor 10.255.0.9 next-hop-self

R1. R2 is the same with no neighbor 10.255.0.1 in the first line. On R3, leave out the first line and next-hop-self, and configure neighbor 10.255.0.9 as shown.

Diagram
What next-hop-self does here
What next-hop-self does here

R1 changes the next hop of ISP routes to its own loopback before sending them to RR.

  1. ISP A routenext hop192.0.2.1
  2. R1 to RRnext hop10.255.0.1
  3. RR to R3next hop kept:10.255.0.1
R3 can reach 10.255.0.1 through OSPF. It cannot reach 192.0.2.1, the ISP address.

Step 4: verify the reflector

First check the sessions. Three neighbours should be Established, and each should have sent RR the routes it learned. Then check the flag, because a session that is up is not proof that RR treats the neighbour as a client.

Example output written for this lesson, not a router capture
RR#show ip bgp summary
Neighbor        V    AS MsgRcvd MsgSent   TblVer  InQ OutQ Up/Down  State/PfxRcd
10.255.0.1      4 64500      52      49       12    0    0 00:14:20        1
10.255.0.2      4 64500      51      49       12    0    0 00:14:18        1
10.255.0.3      4 64500      44      49       12    0    0 00:14:15        0
State/PfxRcd shows a number, not a state name, so all three sessions are Established. R1 and R2 each sent one prefix, 203.0.113.0/24 from their ISP. R3 sent none because it has no BGP routes of its own.
Example output written for this lesson, not a router capture
RR#show ip bgp neighbors 10.255.0.3 | include Reflector
  Route-Reflector Client
This line is the confirmation. If it is missing for a neighbour, that neighbour is an ordinary iBGP peer and RR will not pass other iBGP routes to it.

Now look at the same prefix on RR and on R3. They should disagree about how many paths exist, and that is correct.

Example output written for this lesson, not a router capture
RR#show ip bgp 203.0.113.0
BGP routing table entry for 203.0.113.0/24, version 8
Paths: (2 available, best #1, table default)
  64501
    10.255.0.1 (metric 20) from 10.255.0.1 (1.1.1.1)
      Origin IGP, metric 0, localpref 100, valid, internal, best
  64502
    10.255.0.2 (metric 20) from 10.255.0.2 (2.2.2.2)
      Origin IGP, metric 0, localpref 100, valid, internal
RR holds both paths. Everything compares equal down to the lowest router ID, so the path from R1 (1.1.1.1) wins. That is the only path RR will reflect.
Example output written for this lesson, not a router capture
R3#show ip bgp 203.0.113.0
BGP routing table entry for 203.0.113.0/24, version 9
Paths: (1 available, best #1, table default)
  64501
    10.255.0.1 (metric 30) from 10.255.0.9 (9.9.9.9)
      Origin IGP, metric 0, localpref 100, valid, internal, best
      Originator: 1.1.1.1, Cluster list: 9.9.9.9
One path, learned from RR (9.9.9.9). Originator names R1 as the router that first sent it into the AS, and the cluster list names the reflector it passed through. Those two fields are how a reflected route avoids loops.
Diagram
What RR holds and what R3 gets
What RR holds and what R3 gets

RR keeps two paths and reflects one.

RR tablePath via R1Path via R2Best: R1
R3 tablePath via R1 onlyOriginator 1.1.1.1Cluster list 9.9.9.9
Because only the best path is reflected, R3 cannot choose between R1 and R2 on its own.

The same prefix looks different on all four routers, because each one is handed a different set of paths. RR and R3 are shown above. R1 and R2 follow from the reflection rules.

Diagram
Expected paths for 203.0.113.0/24 on each router
Expected paths for 203.0.113.0/24 on each router
RouterPaths heldBest pathWhy
RR2Via R1Both iBGP paths tie, and the lower router ID, 1.1.1.1, wins
R11Its own eBGP path to ISP ARR does not send a route back to the client it came from
R22Its own eBGP path to ISP BIt also receives RR's best path, but an eBGP path beats an iBGP path when the earlier steps tie
R31Via R1, reflected by RROnly RR's best path is reflected, so R3 cannot see the path through R2
Expected values from the reflection rules in RFC 4456 and the tie-break order, not captured output. Check each router with show ip bgp 203.0.113.0. R3 exits through ISP A even though R2 may be closer to it, which is the cost of reflecting one path.

Finally, prove it works for traffic. From R3, ping 203.0.113.1 should succeed, because the next hop 10.255.0.1 is reachable through OSPF and the packet follows the IGP path to R1 and then out to ISP A.

Step 5: fail the reflector

A single reflector is a single point of failure, and it is better to see that now than during an outage. On RR, shut the interface toward the core and wait for the sessions to time out. With default timers, the hold time is 180 seconds, so expect to wait up to three minutes.

Example output written for this lesson, not a router capture
R3#show ip bgp summary
Neighbor        V    AS MsgRcvd MsgSent   TblVer  InQ OutQ Up/Down  State/PfxRcd
10.255.0.9      4 64500      61      60       10    0    0 00:00:12 Idle
The session to RR is down, so R3 has lost every route it learned through RR. R1 and R2 keep their own eBGP routes, because those do not depend on RR. Only R3, which depended on the reflector, is blind.
Diagram
What happens, in order, when RR fails
What happens, in order, when RR fails

The link to RR goes down and the sessions stop receiving keepalives. When the hold time ends the sessions drop. R3 then loses the routes it learned through RR, while R1 and R2 keep their eBGP routes.

  1. RR link goes downKeepalives stop arrivingThe hold timer keeps running
  2. Hold time endsUp to 180 s on default timersSessions to RR drop
  3. R3 loses its routesEverything learned via RR is withdrawnR3 has no exit
  4. R1 and R2 unaffectedeBGP routes stayTheir ISP sessions are separate
Until the hold time ends, the clients keep using routes learned from the dead reflector.

The count of what fails shows why one reflector is a weak design even though the session count looks small.

Diagram
What one failure takes down (computed)
What one failure takes down (computed)
Design, 10 internal routersClients left blindSessions downWhat remains
Full mesh, one router fails09Every other router still hears the rest directly
One reflector, the reflector fails1010No client has a route learned through a reflector
Two reflectors, one fails011Each client keeps its session to the other reflector
Counts follow the session formulas in the table near the start. Blind means a client has no route learned through a reflector. The two-reflector row assumes every client has a session to both reflectors and the reflectors share a session, so the failed one drops 10 client sessions and 1 reflector session.

Bring the interface back with no shutdown and wait for the sessions to return to Established before the next section.

Worked case: R3 holds the route but cannot use it

Suppose R1 was configured without next-hop-self. RR still reflects ISP A's route, and R3 still receives it, but ping to 203.0.113.1 fails. The sessions are Established, so the table is the place to look.

Example output written for this lesson, not a router capture
R3#show ip bgp 203.0.113.0
BGP routing table entry for 203.0.113.0/24, version 9
Paths: (1 available, no best path)
  64501
    192.0.2.1 (inaccessible) from 10.255.0.9 (9.9.9.9)
      Origin IGP, metric 0, localpref 100, internal
      Originator: 1.1.1.1, Cluster list: 9.9.9.9
The route arrived through the reflector, as the originator and the cluster list show, but its next hop is the ISP A address 192.0.2.1. R3 has no route to that address, so the path is inaccessible and no path is chosen.
Diagram
The next hop on each router before and after the fix
The next hop on each router before and after the fix
RouterWithout next-hop-self on R1With next-hop-self on R1
R1192.0.2.1, reachable over the ISP link192.0.2.1, reachable over the ISP link
RR192.0.2.1, kept unchanged, not reachable10.255.0.1, reachable through OSPF
R3192.0.2.1, inaccessible10.255.0.1, reachable, path chosen
A reflector does not rewrite the next hop, so the router that learned the route from the ISP has to do it.
Diagram
Evidence from the inaccessible route
Evidence from the inaccessible route

R3 has a session to the reflector and receives the route, but the ping fails. The route shows the ISP address as its next hop and the word inaccessible. R3 has no route to the ISP address because the border router did not set itself as the next hop. The fix is next-hop-self on R1 and a soft refresh.

  1. SymptomPing to 203.0.113.1 failssessions are Established
  2. TableR3 shows the routewith no best path
  3. Next hop192.0.2.1, marked inaccessibleR3 has no route to it
  4. CauseR1 passes the ISP next hopon to RR unchanged
  5. Fixnext-hop-self on R1then clear ip bgp 10.255.0.9 soft out
A route that arrives but is not chosen points at the next hop before anything else.

Troubleshooting prompts

Diagram
Check a reflector problem in this order
Check a reflector problem in this order

Start with the loopback routes, then the session, then the client flag, then the next hop, and last the best-path choice.

  1. Loopbacksroute toeach one
  2. SessionEstablished
  3. Flagclient lineon RR
  4. Next hopreachable
  5. Best pathmarked best
Each check depends on the one before it, so a later check on its own can mislead.
R3 session is Established but R3 has no routes

Run show ip bgp neighbors 10.255.0.3 | include Reflector on RR. If the line is missing, the client flag did not apply. Check that neighbor CLIENTS route-reflector-client is under the IPv4 address family, not at the top of the BGP block, and that 10.255.0.3 is really a member of the group.

R3 has the route but it shows inaccessible and is not best

The next hop is not reachable. Run show ip bgp 203.0.113.0 on R3 and read the next hop. If it is 192.0.2.1 or 192.0.2.5, next-hop-self is missing on R1 or R2. Add it under the IPv4 address family and run clear ip bgp 10.255.0.9 soft out.

Every session to RR stays in Active

RR peers with loopbacks, so a missing update-source Loopback0 on either end can make the TCP connection come from an address the other end does not recognise. Check that OSPF carries all four loopbacks with show ip route 10.255.0.9 on a client. The ordering matters: routes to loopbacks first, then BGP.

Technical reference: RFC 4456, BGP Route Reflection. Output above is an example written for this lesson.

Check what you learned

Predict · scenario 1

RR has paths from R1 and R2 for the same prefix. How many paths does R3 receive from RR?

Predict · scenario 2

On which router do you configure route-reflector-client for R3?

Predict · scenario 3

A network has 20 internal routers in a full mesh. How many iBGP sessions does it need, and how many with one route reflector that has all 20 as clients?

Predict · scenario 4

RR learns a route from an eBGP peer. To whom does it send the route?

Predict · scenario 5

R3 shows a reflected route whose next hop is 192.0.2.1 marked inaccessible. What is missing?

Predict · scenario 6

RR fails and its sessions time out. Which statement is true?

Predict · scenario 7

After the reflector is in place, how many paths for 203.0.113.0/24 does R2 hold, and which is best?

Predict · scenario 8

RR is the only reflector and ten clients depend on it. RR fails and the hold timers expire. How many clients lose their reflected routes?

Predict · scenario 9

A network has 50 clients and two reflectors. Every client has a session to both reflectors, and the reflectors share one session. How many iBGP sessions is that?

FAQ

Why does R3 see only one path to 203.0.113.0/24 when RR has two?
A route reflector runs best-path selection and reflects only its best path to its clients. RR has a path from R1 and a path from R2, picks one, and passes that one on. Clients cannot choose between paths the reflector kept to itself.
Does R3 need route-reflector-client configured?
No. The flag is set on the reflector, for each client. R3 has an ordinary iBGP session to RR and does not know it is a client.
Why keep next-hop-self on R1 and R2?
A reflector does not change the next hop. Without next-hop-self, R3 would receive routes whose next hop is an ISP address it cannot reach, and it would mark them inaccessible.