Troubleshooting notes · BGP

BGP route not installed: next hop (inaccessible)

An iBGP router receives a route from its peer but never installs it, and show ip bgp says the next hop is inaccessible. Why iBGP keeps the eBGP next hop, and how next-hop-self fixes it. Real output from Cisco IOS XE 17.18.

The symptom

The internal router has the route in its BGP table, but there's no best path and nothing in the routing table. The next hop is marked (inaccessible).

R1# show ip bgp 203.0.113.0
Paths: (1 available, no best path)
  64500
    3.3.3.3 (inaccessible) from 2.2.2.2 (2.2.2.2)
      Origin IGP, metric 0, localpref 100, valid, internal

Why it happens

When a router passes an eBGP-learned route to an iBGP peer, it doesn't change the next hop. R1 receives 203.0.113.0/24 with the ISP's address (3.3.3.3) as next hop, but R1 has no route to 3.3.3.3, because the ISP side isn't in the internal routing protocol. A path with an unreachable next hop can't be best, so it's never installed.

The fix

On the edge router, advertise itself as the next hop to its iBGP peers, then send the updates again:

R2(config-router)# address-family ipv4
R2(config-router-af)# neighbor 1.1.1.1 next-hop-self
R2(config-router-af)# end
R2# clear ip bgp 1.1.1.1 soft out

next-hop-self only affects updates sent after it's configured. In our test on IOS XE 17.18, R1 still showed the old, inaccessible next hop half a minute later, until the soft refresh resent the updates.

Check it

R1# show ip bgp 203.0.113.0 | include best|from
Paths: (1 available, best #1, table default)
    2.2.2.2 (metric 11) from 2.2.2.2 (2.2.2.2)
      Origin IGP, metric 0, localpref 100, valid, internal, best
R1# show ip route bgp | begin Gateway
B     203.0.113.0/24 [200/0] via 2.2.2.2, 00:00:07

The next hop is now the edge router (2.2.2.2), which R1 reaches through its IGP, and the route is installed.

Practise this fault

This fault is in ENARSI Lab 21, one of the free labs: a ready-made GNS3 project where you find and fix it yourself, with the tested solution. Get it with 14 more free labs, by email:

We’ll email you the download links and occasional lab tips. Unsubscribe with one click, any time. Your address is never shared.

See ENARSI Troubleshooting Labs · What's in the free labs