#

Saturday, August 26, 2017

Change the Next Hop of the BGP Route using the next-hop-self Command

In a case you want to change the next hop address of BGP routes or specific BGP route learned from a specific neighbor, you will have to apply this configuration. Normally you would do this to set the next hop ip address to be a certain exit point from your AS.











Let's see how the BGP table looks like from R1 before configuring next hop commands..





From R1's perspective, 192.168.45.0 route is learned as 2 routes. Obviously they should have been learned from his 2 iBGP neighbors. Also you may notice that the next hop is in another AS.
If you want to make the next hop of the routes learned via R2 to be himself when they are advertised to R1, you will have to use the following command on R2;

R2(config)#router bgp 1
R2(config-router)#neighbor 1.1.1.1 next-hop-self

Now you can see the next hop is changed to 2.2.2.2 which is the router ID of R2..

This next hop 2.2.2.2 is actually not the BGP router ID of R2, it's the updating source interface of R2 to R1..

Note:- 

This does not change any thing on R2's BGP table or other iBGP neighbors..
Does not work with eBGP neighbors..
If you want to do this only for a specific route, you have to use a route map..

No comments:

Post a Comment