Community discussions

MikroTik App
 
lovesthyporn
just joined
Topic Author
Posts: 7
Joined: Fri Dec 18, 2009 1:41 pm

/ip route print detail where dst-address =x.x.x.x/xx FAIL!

Tue Mar 02, 2010 6:57 pm

This is really doing my head in.

I need to find the as-path for x.x.x.x/xx so i run:-

/ip route print detail where dst-address =x.x.x.x/xx

and get:-
/ip route print detail where dst-address =x.x.x.x/xx
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 ADb  dst-address=x.x.x.x/x gateway=x.x.x.x
        gateway-status=x.x.x.x reachable Inta distance=20
No as-path

But if I want to page thru 970k routes it will show!
/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 ADb  dst-address=x.x.x.x/x gateway=x.x.x.x
        gateway-status=x.x.x.x reachable Inta distance=20 scope=40
        target-scope=10 bgp-as-path="257,37,18,7" bgp-origin=igp
        bgp-communities=32:825,32:308,32:502
        received-from=BGProuter
GGrrr
 
User avatar
Eising
Member Candidate
Member Candidate
Posts: 272
Joined: Mon Oct 27, 2008 10:21 am
Location: Copenhagen, Denmark

Re: /ip route print detail where dst-address =x.x.x.x/xx FAIL!

Wed Mar 03, 2010 1:39 pm

It's been like that forever. What I usually do is the following:
:put [ /ip route get [ /ip route find where dst-address=x.x.x.x/yy ] bgp-as-path ]
 
changeip
Forum Guru
Forum Guru
Posts: 3830
Joined: Fri May 28, 2004 5:22 pm

Re: /ip route print detail where dst-address =x.x.x.x/xx FAIL!

Wed Mar 03, 2010 7:53 pm

i had a similiar problem with firewall rules, maybe this helps?
print command in firewall does not show dynamic rules.
You have to write "print all where dynamic"
If you use the word 'all' does that help? dont have a box here to test with myself.
 
User avatar
Eising
Member Candidate
Member Candidate
Posts: 272
Joined: Mon Oct 27, 2008 10:21 am
Location: Copenhagen, Denmark

Re: /ip route print detail where dst-address =x.x.x.x/xx FAIL!

Wed Mar 03, 2010 8:37 pm

/ip route> print all where dynamic
expected end of command (line 1 column 7)
 
lovesthyporn
just joined
Topic Author
Posts: 7
Joined: Fri Dec 18, 2009 1:41 pm

Re: /ip route print detail where dst-address =x.x.x.x/xx FAIL!

Fri Mar 05, 2010 2:04 am

Thanks Eising,

Can I double check the syntax, I'm getting invalid internal item number most of the time
[admin@router] > :put [ /ip route get [ /ip route find where dst-address=1.0.0.0/8 ] bgp-as-path ]
3257,7018,237
[admin@router] > :put [ /ip route get [ /ip route find where dst-address=3.0.0.0/8 ] bgp-as-path ]
invalid internal item number
 
User avatar
Eising
Member Candidate
Member Candidate
Posts: 272
Joined: Mon Oct 27, 2008 10:21 am
Location: Copenhagen, Denmark

Re: /ip route print detail where dst-address =x.x.x.x/xx FAIL!

Mon Mar 08, 2010 1:01 pm

You must be absolutely certain that your find only returns one number.
 
User avatar
janisk
MikroTik Support
MikroTik Support
Posts: 6263
Joined: Tue Feb 14, 2006 9:46 am
Location: Riga, Latvia

Re: /ip route print detail where dst-address =x.x.x.x/xx FAIL!

Mon Mar 08, 2010 1:11 pm

in case of several returns you can try :foreach
 
alcohol
just joined
Posts: 11
Joined: Thu Oct 31, 2013 8:23 pm

Re: /ip route print detail where dst-address =x.x.x.x/xx FAIL!

Mon Dec 18, 2023 7:49 pm

Is this still the case? I've tried with RouterOS6 and RouterOS7 and still see the problem.

I need a reliable and fast way to say "/ip route print where dst-address contains 10.10.10.15"
 
User avatar
mrz
MikroTik Support
MikroTik Support
Posts: 7056
Joined: Wed Feb 07, 2007 12:45 pm
Location: Latvia
Contact:

Re: /ip route print detail where dst-address =x.x.x.x/xx FAIL!

Mon Dec 18, 2023 8:43 pm

/ip route print where 10.10.10.15 in dst-address

Who is online

Users browsing this forum: No registered users and 6 guests