Skip to content
LinkState
Go back

Recursive next-hop resolution that selects a dead exit

Introduction to BGP Route Troubleshooting

BGP carries well‑known and optional transitive attributes that influence path selection. The NEXT_HOP attribute indicates the IP address used as the immediate next hop for the advertised prefix. Other attributes such as LOCAL_PREF, MED, AS_PATH, ORIGIN, and COMMUNITY affect the BGP decision process but do not directly dictate the forwarding next hop.

When a BGP speaker receives a route, it stores the NLRI and its attributes in the BGP RIB (Adj‑RIB‑In). After applying inbound policies, the best‑path algorithm selects a candidate and installs it into the Loc‑RIB. The selected route is advertised to peers (subject to outbound policy) and, if the NEXT_HOP is reachable via the underlying routing table (RIB/FIB), it is installed into the forwarding plane.


Control Plane vs. Data Plane Discrepancies

A route may appear perfectly valid in the BGP control plane—correct NEXT_HOP, acceptable LOCAL_PREF, no policy‑based denial—yet traffic destined for the prefix is dropped or misrouted. This mismatch occurs when recursive next‑hop resolution fails: the BGP NEXT_HOP address is not reachable in the IGP/static routing table, or it is reachable but the forwarding path is blocked by a data‑plane policy (e.g., an ACL, unicast RPF check, or forward‑plane filter).

The control plane still shows the route as “best” because BGP decision‑making does not re‑evaluate reachability after installation; it relies on the underlying unicast RIB to validate the NEXT_HOP at install time. If that validation fails silently (e.g., the route is not installed in the FIB), the operator sees a forwarding outcome that contradicts the control‑plane view.


Identifying Recursive Next‑Hop Resolution Issues

Route Reflection and NEXT_HOP Transparency

In a route‑reflection topology, route‑reflectors (RRs) do not change the NEXT_HOP attribute of a reflected route by default; they forward the attribute exactly as received from the client. If the client learned the route via a third‑party next‑hop (i.e., the NEXT_HOP is not the client’s own address), the RR reflects that third‑party address unchanged. Consequently, all peers of the RR must have a reachable path to that third‑party address through the underlying underlay. A common failure mode is when the RR’s clients reside in different failure domains and the underlay path to the third‑party NEXT_HOP traverses a link that is down or filtered, causing recursive resolution to fail for all reflected copies.

next‑hop‑self vs. Third‑Party NEXT_HOP


Troubleshooting Unavailable Underlay Paths

Verify Interface State

Check that the physical or logical interfaces that should carry traffic to the BGP NEXT_HOP are up and correctly addressed:

show interfaces brief          # admin/oper status
show ip interface <iface>      # IP address and MTU
show ipv6 interface <iface>    # IPv6 environments

If an interface is administratively down, shut, or flapping, the underlying IGP (OSPF/IS‑IS) will withdraw dependent routes, rendering the NEXT_HOP unreachable.

Examine the Unicast RIB for the NEXT_HOP

Even with interfaces up, the IGP may have installed a black‑hole route (static to Null0, OSPF LSA with infinite metric, etc.). Inspect the RIB:

show ip route <next-hop-address>
show ip route vrf <vrf> <next-hop-address>   # VRF‑aware

Look for:

show ip cef <next-hop-address>          # Cisco IOS/XE
show fib route <next-hop-address>       # Juniper/Junos

Absence of a CEF/FIB entry while the RIB entry exists signals a forwarding‑plane install issue (often due to TCAM/resource exhaustion or a feature like uRPF dropping the packet).

Correlate BGP State with the Underlying Routing Table

show ip bgp <prefix>               # BGP attributes, NEXT_HOP, state
show ip bgp neighbors <peer> advertised-routes   # what is sent
show ip route <prefix>             # prefix installed in RIB?
show ip route <next-hop-address>   # NEXT_HOP reachability
show ip bgp rib-failure            # BGP routes that failed to install```

A route appearing in `show ip bgp` with a valid NEXT_HOP but absent from `show ip route <prefix>` (or present in `show ip bgp rib-failure`) indicates a recursive resolution failure.

---

## Investigating Policy‑Blocked Underlay Paths  ### Data‑Plane Policies vs. BGP Policies  
Policies that affect the data plane are distinct from inbound/outbound BGP route‑maps. Examples include:  - **ACLs** applied inbound or outbound on an interface (`ip access-group`).  
- **Unicast RPF** (`ip verify unicast source reachable-via rx|any`).  
- **Forward‑plane filters** (QoS policers, ACL‑based forwarding, TCAM‑based drop policies).  
- **VPN/VRF import/export maps** that may silently discard traffic if the target VRF lacks a route.  

These policies do not alter BGP attributes; they merely decide whether a packet matching a certain source/destination address is allowed to be forwarded.

### Inspect Route Maps and Access Lists  
```bashshow route-map <map-name>        # sequence, match/set clauses
show ip access-list <acl-name>   # view ACEsshow ip prefix-list <list-name>  # if prefix‑list used in policy

Look for:

Verify Policy Application on the Path ```bash

show ip interface # confirms inbound/outbound ACLs show ip policy # shows PBR route‑maps applied globally show ip cef exact-route # shows which ACL/policy matched debug ip packet detail # (use sparingly) see drops due to ACL/uRPF


If a packet destined for the prefix is dropped by an ACL whose rule matches the NEXT_HOP or the destination, the BGP control plane remains unaware because the drop occurs after the forwarding decision.

---

## Resolving Forwarding Outcome Discrepancies  

### Adjust Route Attributes for Correct NEXT_HOP Resolution  
When the issue stems from an unreachable third‑party NEXT_HOP, the operator can:  

1. **Enable next‑hop‑self** at the point of reflection or at the egress peer:  
   ```bash
   router bgp 65000
     neighbor 10.0.0.2 next-hop-self
  1. Modify the BGP NEXT_HOP attribute via an outbound route‑map:
    route-map SET-NEXT-HOP permit 10
      set ip next-hop peer-address
    !
    router bgp 65000     neighbor 10.0.0.3 route-map SET-NEXT-HOP out   ```
    
  2. Adjust the IGP to ensure the third‑party address is reachable (add a static route, fix an OSPF area, repair a broken link).

Implement Route Policies for Intended Forwarding Behavior

If the problem is a data‑plane filter blocking the path, adjust or remove the offending policy:

After changes, clear the affected BGP sessions or perform a soft reset to re‑evaluate attributes:

clear ip bgp <neighbor> soft out

CLI Examples for Corrective Actions

Example 1 – Fixing missing NEXT_HOP via static route:

ip route 10.200.0.0 24 10.10.10.2   # route to the BGP NEXT_HOP```

**Example 2 Applying next‑hop‑self at a route‑reflector:**  
```bash
router bgp 65000
  neighbor 10.0.0.5 route-reflector-client
  neighbor 10.0.0.5 next-hop-self

Example 3 – Using a route‑map to enforce a specific NEXT_HOP:

route-map FIX-NH permit 10
  match ip address prefix-list PREFIX-100
  set ip next-hop 10.10.10.1
!
router bgp 65000
  neighbor 10.0.0.7 route-map FIX-NH out

After applying, verify installation: ```bash show ip bgp 100.64.0.0/16 show ip route 100.64.0.0/16show ip cef 100.64.0.0/16


---

## Scaling Limitations and Considerations  

### Impact of Network Size on BGP Route Resolution  
As the number of BGP prefixes grows, the likelihood of encountering a NEXT_HOP that resides in a distant or failure‑prone part of the underlay increases. Large‑scale networks often rely on hierarchical routing (core/distribution/access) where the BGP NEXT_HOP may be a loopback address advertised via IGP. If the IGP experiences churn, many BGP routes may simultaneously lose recursive resolution, leading to micro‑loops or traffic black‑holes until the IGP reconverges.

### Effects of Route Reflection on Scalability  
Route reflection reduces the full‑mesh peering requirement but introduces a **single point of failure** for NEXT_HOP transparency. If the RR does not enforce next‑hop‑self, all clients inherit the original third‑party NEXT_HOP. A failure in the path to that address affects every reflected copy, amplifying the impact. Conversely, configuring next‑hop‑self on the RR increases the number of distinct NEXT_HOP values (one per RR client) but guarantees that each client only needs to resolve the RR’s own address, improving failure isolation.

### Best Practices for Managing Large‑Scale BGP Networks  
- **Enforce next‑hop‑self at route‑reflectors** or at the edge of each failure domain to limit the scope of NEXT_HOP dependencies.  
- **Monitor IGP convergence** with tools like `show ip ospf neighbor`, `show isis database`, and track SPF run times; set appropriate timers (e.g., OSPF `spf-delay`, `spf-holddown`) to avoid excessive churn.  
- **Use BGP PIC (Prefix Independent Convergence)** or similar features to pre‑program backup paths when the primary NEXT_HOP becomes unavailable.  
- **Regularly audit ACLs and uRPF** configurations on transit interfaces to ensure they do not inadvertently block legitimate NEXT_HOP traffic.  
- **Leverage BGP attributes like `originator-id` and `cluster-list`** to detect routing loops caused by mis‑configured reflection.

---

## Advanced Troubleshooting Techniques  

### Using Debugging Tools  
Debug commands provide real‑time insight into state changes:  
```bashdebug ip bgp updates               # see BGP UPDATE messages, NEXT_HOP changes
debug ip bgp neighbor-events       # track session flapsdebug ip routing                   # observe RIB insert/delete events

Note: Use debugging sparingly on production routers; limit to specific peers or prefixes with an access-list or route-map filter to avoid excessive CPU load.

Analyzing Network Traffic with Packet Capture

When suspecting data‑plane drops, capture packets on the interface facing the NEXT_HOP:

monitor capture mycap interface GigabitEthernet0/0 buffer size 10000 max-size 1500
monitor capture mycap start
# generate traffic (e.g., ping) then stopmonitor capture mycap stop
monitor capture mycap export tftp://10.1.1.1/mycapture.pcap

Inspect the capture for:

Utilizing Visualization Tools for Complex Topologies

Tools such as NetBox, Nautobot, or custom scripts that pull LLDP/CDP neighbors and BGP peerings can generate a graphical view of the underlay and overlay. Overlaying BGP NEXT_HOP reachability on this diagram helps quickly isolate where the underlay path breaks or where a policy blocks traffic.


End of document.


Share this post on:

Previous Post
Why local-pref beats a shorter AS_PATH
Next Post
eBGP multihop over loopbacks without session roulette