Octet

What does next-hop-self do, and when do you need it?

Show the answer

Say this first

When an edge router passes an eBGP route to its iBGP peers, it keeps the original next hop: the ISP's address on the shared link. If the IGP does not carry that link subnet, internal routers mark the route inaccessible and never install it. neighbor x next-hop-self on the edge router rewrites the next hop to its own update-source address (its loopback) on routes it sends to that iBGP peer.

Go deeper

The problem

R1 learns 198.51.100.0/24 from ISP1 at 192.0.2.1 and sends it to R3 over iBGP. R3 has no route to 192.0.2.0/30, so the route is not valid (no *) and not best (no >):

Output
R3# show ip bgp | begin Network
     Network          Next Hop            Metric LocPrf Weight Path
   i 198.51.100.0     192.0.2.1                0    100      0 64496 i

The fix on the edge router

Cisco IOS
router bgp 64500
 neighbor 10.255.0.3 remote-as 64500
 neighbor 10.255.0.3 update-source Loopback0
 neighbor 10.255.0.3 next-hop-self

After clear ip bgp 10.255.0.3 soft out on R1:

Output
R3# show ip bgp | begin Network
     Network          Next Hop            Metric LocPrf Weight Path
 *>i 198.51.100.0     10.255.0.1               0    100      0 64496 i

The other fix

Put the external link into the IGP as a passive interface. It works, but it spreads external subnets through your IGP and has to be remembered for every new peering. next-hop-self is the common choice.

Traps

  • Configuring next-hop-self on the router that receives the route. It belongs on the edge router that sends it into iBGP.
How did you do?Book 4.1 Global Internet