Community discussions

MikroTik App
 
sftn2a
just joined
Topic Author
Posts: 3
Joined: Tue Feb 25, 2014 4:39 am

Command stopped working in ROS 6.x: !routing-mark

Thu Mar 27, 2014 5:31 am

I have a script that looks for a list of routes and select only the routes without routing-mark.
Before ROS 6.x I was using this command sucessfull: ":put [/ip route find dst-address=0.0.0.0/0 !routing-mark];"
I try all version 6.x. The bellow sample copy/paste was executed on ROS-6.11, as you can see "!routing-mark" does not work anymore.

[admin@MikroTik] > ip route export
# mar/27/2014 02:16:24 by RouterOS 6.11
/ip route
add distance=1 gateway=172.23.70.252 routing-mark=xx
add distance=1 gateway=172.23.70.253 routing-mark=yy
add distance=1 gateway=172.23.70.254 <<< Here you can see route 0.0.0.0/0 without routing-mark

admin@MikroTik] > /ip route print terse
0 A S dst-address=0.0.0.0/0 gateway=172.23.70.252 gateway-status=172.23.70.252 reachable via ether1 distance=1 scope=30 target-scope=10 routing-mark=xx
1 A S dst-address=0.0.0.0/0 gateway=172.23.70.253 gateway-status=172.23.70.253 reachable via ether1 distance=1 scope=30 target-scope=10 routing-mark=yy
2 A S dst-address=0.0.0.0/0 gateway=172.23.70.254 gateway-status=172.23.70.254 reachable via ether1 distance=1 scope=30 target-scope=10
3 ADC dst-address=172.23.70.0/24 pref-src=172.23.70.117 gateway=ether1 gateway-status=ether1 reachable distance=0 scope=10

[admin@MikroTik] > :put [/ip route find dst-address=0.0.0.0/0 and routing-mark="xx"];
*2 <<<<<<< OK route with ID 0 was found
[admin@MikroTik] > :put [/ip route find dst-address=0.0.0.0/0 and routing-mark="yy"];
*5 <<<<< OK route with ID 1 was found
[admin@MikroTik] > :put [/ip route find dst-address=0.0.0.0/0 and !routing-mark];
<< No result, route with ID 2 should be printed.

I tried other ways without much sense: ="", = , =blank, =null, =nil =! but without success! Copy/paste follow:

[admin@MikroTik] > :put [/ip route find dst-address=0.0.0.0/0 and routing-mark=""];

[admin@MikroTik] > :put [/ip route find dst-address=0.0.0.0/0 and routing-mark=];
expected routing-mark value (line 1 column 61)
[admin@MikroTik] > :put [/ip route find dst-address=0.0.0.0/0 and routing-mark=!];

[admin@MikroTik] > :put [/ip route find dst-address=0.0.0.0/0 and routing-mark=''];
expected routing-mark value (line 1 column 61)
[admin@MikroTik] > :put [/ip route find dst-address=0.0.0.0/0 and routing-mark=nil];

[admin@MikroTik] > :put [/ip route find dst-address=0.0.0.0/0 and routing-mark=null];


I appreciate if someone can help me!
 
User avatar
skot
Long time Member
Long time Member
Posts: 584
Joined: Wed Nov 30, 2011 3:05 am

Re: Command stopped working in ROS 6.x: !routing-mark

Thu Mar 27, 2014 7:01 pm

This topic was talked about here: http://forum.mikrotik.com/viewtopic.php ... 09#p395035, but the solution seems more like a workaround... "If routing mark is not nothing"?? But it works...

ros code

:put [/ip route find dst-address=0.0.0.0/0 and !routing-mark~""]