Good day,
What syntax do I need to be able to lookup routes like I do on both Cisco and Juniper, e.g.
sh ip route 8.8.8.8
Routing entry for 8.8.8.0/24
Known via "bgp (removed)", distance 20, metric 0
Tag (removed), type external
Last update from (removed) 7w0d ago
Routing Descriptor Blocks:
* (removed), from (removed), 7w0d ago
Route metric is 0, traffic share count is 1
AS Hops 3
Route tag (removed)
Right now I have to know the network I am looking for which makes debugging issues quite annoying. I am using /ip route print where dst-address=8.8.8.8 which returns nothing but /ip route print dst-address=8.8.8.0/24 returns the network fine (problem is knowing what to query).
I believe you should be able to use the “in” operator, e.g.
/ip route print where 8.8.8.8 in dst-addressThis will give you all routes that in some way or another have a dst-match against 8.8.8.8, including 8.8.8.0/24, as well as 0.0.0.0/0, and anything in between.
It’s not exactly a route resolution (e.g. if 8.8.8.0/24 is already resolved to a particular interface, rather than an IP, the above will keep looking for all items involved in larger subnets too), but it should certainly narrow down your suspects when debugging.
There’s also the “check” command in that same menu, which will tell you the next hop IP address, e.g.
/ip route check 8.8.8.8That will tell you only the next hop IP, which means you must still do a check on that next IP to find out the interface the packet will be sent through (unless the “next hop” is the actual IP you’re looking for, in which case you know that IP is directly connected to the router).
Never knew about the check command, your right its a bit limited but it should help with debugging internal OSPF related issues. For BGP related stuff (where allot of routes are going to point to the same link) I’ll have to deal with the “in dst-address” method (On my routers that carry full BGP tables there is a big difference in speed).
Thanks for the information though, very useful.