Community discussions

MikroTik App
 
mknnoc
Trainer
Trainer
Topic Author
Posts: 229
Joined: Thu Feb 28, 2008 6:40 am
Location: cambodia

show ip route x.x.x.x

Sat Nov 27, 2010 4:44 am

Is it possible to do "show ip route x.x.x.x"?
 
User avatar
mrz
MikroTik Support
MikroTik Support
Posts: 7211
Joined: Wed Feb 07, 2007 12:45 pm
Location: Latvia
Contact:

Re: show ip route x.x.x.x

Sat Nov 27, 2010 7:46 pm

/ip route print where dst-address="x.x.x.x/x"
 
fewi
Forum Guru
Forum Guru
Posts: 7717
Joined: Tue Aug 11, 2009 3:19 am

Re: show ip route x.x.x.x

Sat Nov 27, 2010 8:10 pm

With the caveat that it's going to look EXACTLY for that prefix. It doesn't search the routing table for a route, it matches entries as strings. If you have a route for 192.168.0.0/24 and 192.168.0.0/25 then searching for 192.168.0.10 won't bring up either one.

There is no direct equivalent to 'sh ip ro'. You can sort of fudge it with regex searches, but you might not catch supernets, and will never catch the default route.
 
mknnoc
Trainer
Trainer
Topic Author
Posts: 229
Joined: Thu Feb 28, 2008 6:40 am
Location: cambodia

Re: show ip route x.x.x.x

Mon Nov 29, 2010 5:07 am

Yes, it is correct that "ip route print where dst=x.x.x.x" can not look up for supernet.
Is there any way to work around to find supernet or exit interface?
 
blake
Member
Member
Posts: 426
Joined: Mon May 31, 2010 10:46 pm
Location: Arizona

Re: show ip route x.x.x.x

Mon Nov 29, 2010 6:17 am

/ip route print where 192.0.2.10 in dst-address
Works in 4.9 and up for me.
 
fewi
Forum Guru
Forum Guru
Posts: 7717
Joined: Tue Aug 11, 2009 3:19 am

Re: show ip route x.x.x.x

Mon Nov 29, 2010 6:42 am

+5 for solving my biggest goddamn annoyance with RouterOS.

I owe you a beer.
From the PM for Karma. Thank you. Times a thousand. Never knew.
 
mknnoc
Trainer
Trainer
Topic Author
Posts: 229
Joined: Thu Feb 28, 2008 6:40 am
Location: cambodia

Re: show ip route x.x.x.x

Mon Nov 29, 2010 8:30 am

I am using ROS4.13 but it doesn't work for me as below:
ip_route_print.png
You do not have the required permissions to view the files attached to this post.
 
User avatar
mrz
MikroTik Support
MikroTik Support
Posts: 7211
Joined: Wed Feb 07, 2007 12:45 pm
Location: Latvia
Contact:

Re: show ip route x.x.x.x

Mon Nov 29, 2010 8:43 am

/ip route print where dst-address=192.168.86.1
will not work because, route in routing table is 192.168.86.0/24 which is not equal to 192.168.86.1

If you want to see what routes can be used to resolve an address use the command that blake mentioned
/ip route print where 192.168.86.1 in dst-address
 
blake
Member
Member
Posts: 426
Joined: Mon May 31, 2010 10:46 pm
Location: Arizona

Re: show ip route x.x.x.x

Mon Nov 29, 2010 10:18 am

From the PM for Karma. Thank you. Times a thousand. Never knew.
You're welcome. I recently found that little gem while trying to help a user on a mailing list with this exact problem.

It was a little 'hard' to find because the in keyword doesn't syntax highlight as it does in 'where dst-address in x.x.x.x' leading you to believe it would not be a valid command.
 
dcosta
just joined
Posts: 8
Joined: Mon Mar 28, 2016 7:42 pm

Re: show ip route x.x.x.x

Mon Sep 12, 2016 8:10 pm

Hello,

I have CCR1009-8G-1S-1S+ with RouterOS 6.36.2.
After I configure a full BGP /ip route print where 8.8.8.8 in dst-address it take several minutes to get a result. Should I use another command to check which path is being used to reach 8.8.8.8?
Or isn’t supposed to run full bgp on a CCR1009-8G-1S-1S+ ?
If I do this kind of query (show ip route 8.8.8.8) in other router, also with full BGP, I get the answer in a few seconds.

Thanks,
David Costa
 
User avatar
pukkita
Trainer
Trainer
Posts: 3051
Joined: Wed Dec 04, 2013 11:09 am
Location: Spain

Re: show ip route x.x.x.x

Mon Sep 12, 2016 9:14 pm

I know it's not the same, but...
/ip route check 8.8.8.8
Will show you the exit interface; RouterOS Tools > traceroute will show the path along with latencies to all involved hosts.

BGP will be Multi-Core optimized on ROS 7.
 
User avatar
BrasDeutscher
newbie
Posts: 41
Joined: Sat Sep 03, 2016 12:31 am
Location: Brazil

Re: show ip route x.x.x.x

Thu Sep 15, 2016 4:15 am

/ip route print detail
Flags: X - disabled, A - active, D - dynamic, C - connect, S - static, r - rip, b - bgp, o - ospf, m - mme,
B - blackhole, U - unreachable, P - prohibit
0 ADS dst-address=0.0.0.0/0 gateway=192.168.168.1 gateway-status=192.168.168.1 reachable via e1-gateway distance=0 scope=30 target-scope=10
vrf-interface=e1-gateway

1 ADC dst-address=172.16.16.0/21 pref-src=172.16.16.1 gateway=br1 gateway-status=br1 reachable distance=0 scope=10

2 DC dst-address=172.16.254.0/29 pref-src=172.16.254.1 gateway=e5 gateway-status=e5 unreachable distance=255 scope=10

3 ADC dst-address=192.168.168.0/29 pref-src=192.168.168.3 gateway=e1-gateway gateway-status=e1-gateway reachable distance=0 scope=10