Impact of next-hop-self in BGP

Posted on April 11, 2010

As you know in BGP the next hop will only be changed for eBGP neighbors, iBGP will not change the next hop. The “problem” is that if you didn’t advertise in the IGP the link between the eBGP neighbors you’ll run into an issue.

I built a 6 router topology that will be used for inter-AS MPLS so we’ll just use a few routers for the eBGP.


Here is my BGP config on the eBGP device

R2-ASBR(config-router)#do sh run | s router bgp
router bgp 100
 no synchronization
 bgp log-neighbor-changes
 neighbor 54.5.1.1 remote-as 100
 neighbor 54.5.1.1 update-source Loopback0
 neighbor 54.5.1.1 send-community
 neighbor 90.9.24.4 remote-as 200
 no auto-summary
 !

All is good we are receiving routes from our neighbor

R2-ASBR(config-router)#do sh ip bgp
BGP table version is 2, local router ID is 54.5.2.2
Status codes: s suppressed, d damped, h history, * valid, > best, i - internal,
              r RIB-failure, S Stale
Origin codes: i - IGP, e - EGP, ? - incomplete

   Network          Next Hop            Metric LocPrf Weight Path
*> 64.3.0.0/16      90.9.24.4                0             0 200 i

Now lets have a look on R1 our route reflector

R1-RR(config-router)#do sh ip bgp
BGP table version is 1, local router ID is 54.5.1.1
Status codes: s suppressed, d damped, h history, * valid, > best, i - internal,
              r RIB-failure, S Stale
Origin codes: i - IGP, e - EGP, ? - incomplete

   Network          Next Hop            Metric LocPrf Weight Path
* i64.3.0.0/16      90.9.24.4                0    100      0 200 i

Not good, we are missing the > in our BGP table … Why? Because we are iBGP neighbors so we won’t change our next hop value and as we haven’t advertised the network 90.9.24.0 in the IGP there is no route to join the next hop.

As usual there is a magical command to get that running, neighbor x.x.x.x net-hop-self. When using this command it will change the next hop value for this neighbor only to our update source ip address. Lets see that in action.

R2-ASBR(config-router)#router bgp 100
R2-ASBR(config-router)#neighbor 54.5.1.1 next-hop-self

And see what happens on our RR

R1-RR(config-router)#do sh ip bgp
BGP table version is 2, local router ID is 54.5.1.1
Status codes: s suppressed, d damped, h history, * valid, > best, i - internal,
              r RIB-failure, S Stale
Origin codes: i - IGP, e - EGP, ? - incomplete

   Network          Next Hop            Metric LocPrf Weight Path
*>i64.3.0.0/16      54.5.2.2                 0    100      0 200 i

Next hop has changed to our Loopback0 interface which is advertised in IGP so everything works now!


1 Reply to "Impact of next-hop-self in BGP"

  • J Thomas
    July 31, 2012 (14:28)
    Reply

    Dear Remi,

    I am preparing for CCNP ROUTE.

    Is this mean that EBGP will update the next-hop address as the routes are passed to the neighbor routers but IBGP will NOT update the next-hop address as the routes are passed to the neighbor routers?

    The Cisco IOS “next-hop-self” command is used to inform the next downstream router the next hop address destination network ?

    Thanks in advance…


Got something to say?

Some html is OK