When troubleshooting or analyzing network configurations in Junos, it is often necessary to view the routing table entries associated with a specific next-hop address. This can help in validating routing policies, debugging path selection, or ensuring that traffic is routed correctly through the intended next hop.
The show route next-hop command in Junos OS allows you to display all routing table entries pointing to a specified next-hop IP address. You can also use the detail option to view additional information about these entries.
show route next-hop
detail
show route next-hop <next-hop-ip-address>
root@Lab> show route next-hop ?Possible completions: <next-hop> IP address of next hop that is destination for entriesroot@Lab> show route next-hop 10.219.31.166
inet.0: 5 destinations, 5 routes (5 active, 0 holddown, 0 hidden)+ = Active Route, - = Last Active, * = Both
0.0.0.0/0 *[Static/5] 02:26:58 > to 10.219.31.166 via fxp0.0
inet6.0: 1 destinations, 1 routes (1 active, 0 holddown, 0 hidden)
root@Lab>Detailed Route Information - To view detailed information about the routes, use the detail option:
root@Lab> show route next-hop 10.219.31.166 detail
inet.0: 5 destinations, 5 routes (5 active, 0 holddown, 0 hidden)0.0.0.0/0 (1 entry, 1 announced) *Static Preference: 5 Next hop type: Router, Next hop index: 335 Address: 0x744a784 Next-hop reference count: 3, key opaque handle: 0x0, non-key opaque handle: 0x0 Next hop: 10.219.31.166 via fxp0.0, selected Session Id: 0 State: <Active Int Ext> Age: 2:28:24 Validation State: unverified Task: RT Announcement bits (2): 0-KRT 2-RT AS path: I Thread: junos-main Route Record: Recorded nexthop 0x744a784 as-index: 1 (Recorded) com-index 0 (Not-Recorded)
root@Lab>