Friday, May 17, 2013


Use the BGP "neighbor <IP> next-hop-self" command in order to avoid using static routes on R1.
(Remember the static route which was created in the post 1.4 so that the next-hop i.e. could be reachable.)

Preconfiguration :  Whatever has been configured until the last post (i.e. 1.4 Injecting IGP into BGP)

So what is this BGP NEXT_HOP_SELF ???
As seen in the last post, when EBGP routes are being advertised to an IBGP peer, the next-hop address of the route is left unchanged. This is the default behavior.
Now, according to this behavior, R1's next-hop address to was, which was not initially reachable. We created a static route on R1 for ensuring that the path to is available.

(Note : The BGP route can only be a best route i.e. it will enter the routing table, if the next-hop is accessible/reachable.)

However, creating static routes is not always a feasible option. (It would be a nightmare to create static routes, if R2 had, say 50 peers each with wholly different subnet!!!!!!!)

BGP NEXT HOP SELF comes to our rescue, here!!!

What is BGP NEXT HOP SELF all about ???
When BGP NEXT HOP SELF is configured, the next-hop attribute gets modified, no matter to whichever peer (IBGP/EBGP) you are advertising the routes to.

In our case, when R2 advertises the route to R1 with the next-hop-self configuration, R1's next-hop address to becomes (R2's physical IP address i.e. the IP address on which the BGP peering with R1 has been made.)

R2 configuration

R2(config)#router bgp 100

R2(config-router)#neighbor next-hop-self

R4 configuration 

R4(config)#router bgp 100

R4(config-router)#neighbor next-hop-self


*May 15 13:04:37.660: %SYS-5-CONFIG_I: Configured from console by console

Now after this configuration, you no longer need the static route on R1.

R1 configuration

R1(config)#no ip route

R1(config)#no ip route

(The static route to was created for the routes coming from AS 40 via R4.)

Now let us check R1's output

Fig 1.5.1
From Fig 1.5.1, see the Next Hop column of the "show ip bgp" output.
You will see that all the routes are best routes and the Next Hop address is now, which is the directly connected subnet, hence already in the routing table.
All other attributes remain the same 

No comments:

Post a Comment