BGP and Route-Map


So I have to create route-reflector server on R3 and R4 as client so that the network of 10 get’s showing on R4. The issue started when I created a route-map on R3 with set ip next hop of R4 on out direction so that R4 make the route of 10 as best in it’s routing table. But when I apply the route on R3 in out direction the route on R4 got removed, however when I applied the same route-map on R4 the route get showed as best. Hope You understand that!! Please why I’ve been seeing this behavior??

Hello Speedosuper111

From what I understand, you created:

  • a route map on R3 applied to the BGP peering with R4 in an outbound direction
  • the route map is applied to the 10.1.1.0/24 network
  • the route map sets the next hop IP for that network to the IP address of R4 (let’s say 34.1.1.4)

So when the UPDATE message reaches R4, it says that the 10.1.1.0/24 network can be reached with a next hop of 34.1.1.4.

When this is done, R4 will not install that route into its BGP table. This is because BGP will not accept any UPDATE from a peer that tells it to use its own IP address as a next hop. This is a loop prevention mechanism.

Now you did say that:

So if you create the same route map on R4 applied to the peering with R3 in an incoming direction, the route appears? Hmm, that’s interesting. If that is the case, this may be due to a couple of reasons:

  • The route passes initial BGP validation checks (because the next-hop is not R4 at receipt time)
  • Then R4 applies your inbound route-map, which modifies attributes locally after the route is already accepted

So it may simply be the order of operations that allows the route to enter the BGP table. However, even though this “works” to install the route in the BGP table, setting the next-hop to yourself is still not a valid routing strategy and won’t result in proper packet forwarding.

I hope this has been helpful!

Laz