Page 1 of 1
Moving Static Queue Above Dynamic Queues
Posted: Sat Sep 29, 2007 11:25 pm
by skillful
I use this code in a hotspot login script
/queue simple move [find name=cached] 0
to move a particular rule to the topmost position. The script executes fine but rule does not get to position "0". The rule always end up below the dynamic rules.
I can manually move the rule to position "0" in winbox but the script can only move it as far as the dynamic rules. I am using ROS3.0RC5.
Re: Moving Static Queue Above Dynamic Queues
Posted: Mon Oct 01, 2007 12:56 pm
by skillful
Anyone?
Re: Moving Static Queue Above Dynamic Queues
Posted: Tue Oct 02, 2007 12:53 am
by mps01k
hello i, i am trying to do the exactly same thing for the same reason. will delete my message or move it here as it is the same topic.
michael
Re: Moving Static Queue Above Dynamic Queues
Posted: Tue Oct 02, 2007 12:25 pm
by mps01k
hello ,,
if we cant move the static above the dynamic with script what about moving the dynamic below the static???
anybody out there with anygood ideas??
Re: Moving Static Queue Above Dynamic Queues
Posted: Tue Oct 02, 2007 1:29 pm
by mps01k
tried this but somting is wrong in it
{
:local name
/queue simple
:foreach i in=[/queue simple] do={
:set name [get $i name]
:if ($name=!"proxy_cache") do={
/queue simple move 0 6
}
}
Re: Moving Static Queue Above Dynamic Queues: Possible bug?
Posted: Fri Oct 05, 2007 8:45 am
by alex_rhys-hurn
Hi Folks,
Have we stumbled upon a bug here?
I am able to replicate exactly what you are saying, in that dynamic queues for hotspot ALWAYS join at the top of the list, BUT this is not ALWAYS true for ALL dynamic queues.
I tried this also with my PPPOE server, and the PPPOE dynamic queues ALWAYS join at the bottom of the list (i.e. AFTER the static queues) therefore negating the need for the script that you guys (and myself) are looking for.
So, can someone at Mikrotik confirm for us what is the expected normal behaviour of dynamic queues?
Regarding the script, the first one that Skillful proposes always sends the static queues to the bottom because (I believe) we havent issued the print command before running the move command.
So I think mps01k is heading in the right direction in that we must query the queues first and then issue the move command.
I am not too good on scripting but am trying to work it through.....
Re: Moving Static Queue Above Dynamic Queues
Posted: Mon Oct 08, 2007 10:09 pm
by alex_rhys-hurn
I have tried and failed with a script to solve this....
Did you guys solve it?
Re: Moving Static Queue Above Dynamic Queues
Posted: Mon Oct 08, 2007 10:54 pm
by mps01k
still no luck,, and really need this!!!!!!!
Re: Moving Static Queue Above Dynamic Queues
Posted: Tue Oct 09, 2007 12:23 pm
by skillful
I think it must be a bug.
Re: Moving Static Queue Above Dynamic Queues
Posted: Wed Oct 10, 2007 11:50 pm
by alex_rhys-hurn
OK, so if we all think its a bug, then lets all send in our supout to
support@mikrotik.com.
So, to clarify my problem, dynamic HOTSPOT queues ALWAYS jump to the top of the list above any static simple queues. But when I do dynamic PPPOE queues they stay at the bottom, leaving the static simple queues at the top where they can work.
Just to ask you, which version ROS are you using? I have had this with 2.9.46
Regards
Alex
Re: Moving Static Queue Above Dynamic Queues
Posted: Wed Oct 10, 2007 11:58 pm
by alex_rhys-hurn
OK, I have written support.
Lets hope they can help us!
Rgds
Alex
Re: Moving Static Queue Above Dynamic Queues
Posted: Thu Oct 11, 2007 6:05 pm
by alex_rhys-hurn
Ok folks,
This is the feedback from the ever helpful Sergejs at Mikrotik Support. (Their support is great isnt it?)
Hello Alex,
Yes, it is working as designed, HotSpot queues are placed to the of the list.
It is possible to use 'on-login' and 'on-logout' script for the HotSpot user profile, when script is executed when any user logged in.
Identification is required for the 'queue simple' entry, in order script may find static 'queue' and place to the top,
you may use this script, that check for the priority (any other option might be used),
:foreach n in=[/queue simple find priority=1] do={ /queue simple move $n [:pick [/queue simple find] 0] }
Regards,
Sergejs
So he proposes a script! Which is where we started with this anyway.
I am going to start playing with this tonight. Will revert.
Rgds
Alex
Re: Moving Static Queue Above Dynamic Queues (RESOLVED)
Posted: Thu Oct 11, 2007 9:08 pm
by alex_rhys-hurn
OKAY!
Now I am getting the idea.
Sergejs script looks for queue priorities, then moves the script of the relevant priority to position zero. Then the script loops round and repeats until finished.
I cant pretend to understand fully all the script variables, but it is working.
So, standard pppoe and hotspot dynamic simple queues have a default priority of 8 the loweest priority.
So I changed the priority of my static simple queues to 1 and then ran the script, and hey presto all the statics jump to the top of the list.
So now I have set the script to run on each login event of the hotspot user, and it is working.
Now I wonder how to set "on user login" scripts with usermanager.... but thats for another time.
Rgds
Alex
Re: Moving Static Queue Above Dynamic Queues
Posted: Sat Oct 13, 2007 2:51 am
by mps01k
i need this for usermanager not for only hotspot.. still no luck getting anything to work and have tried .
Re: Moving Static Queue Above Dynamic Queues
Posted: Sun Oct 14, 2007 2:43 pm
by alex_rhys-hurn
Hey mps01k
Can you describe fully what you are trying to do?
The script Sergejs suggest is working perfectly for me. I am using for dynamic scripts from both PPPOE server AND hotspot server. And it works for me both using usermanager and also the built in Hotspot users and PPPOE secrets.
It moves the queues to exactly where I want them, so to the original query in the this topic we have (sergejs have) solved it.....
I see that you are setting a wisp in Honduras via satelite? I am doing this in Kenya with a WISP with 2 x VSAT dishes, and all works great.
Post your config, we help you out.
Rgds
Alex
Re: Moving Static Queue Above Dynamic Queues
Posted: Mon Oct 15, 2007 10:32 pm
by mps01k
hello ,
this is the error i am getting
[admin@MikroTik] /ip hotspot active> print
Flags: R - radius, B - blocked
# USER ADDRESS UPTIME SESSION-TIME-LEFT IDLE-TIMEOUT
0 R casm 192.168.250.3 29m39s
1 R favio 192.168.250.11 1h13m32s
2 R lucia 192.168.250.14 16m5s
[admin@MikroTik] /ip hotspot active> :foreach n in=[/queue simple find priority=1] do={ /queue simple move $n [:pick [
/queue simple find] 0] }
destination number too large
[admin@MikroTik] /ip hotspot active>
Re: Moving Static Queue Above Dynamic Queues
Posted: Wed Oct 17, 2007 7:55 am
by alex_rhys-hurn
can you tell me what the priority you are giving to the hotspot dynamic queues? just double click one and look for priority.
Its not clear from your dump...
Re: Moving Static Queue Above Dynamic Queues
Posted: Wed Oct 17, 2007 11:43 pm
by mps01k
i am using from 8 to 5 on the dynamic queues and 1 on the static queue i want to move.
Re: Moving Static Queue Above Dynamic Queues
Posted: Thu Oct 18, 2007 7:48 am
by alex_rhys-hurn
Ok,
so you have changed the script to choose queue priority 1 which is correct, as that is the static that you have.
When I try to run this from the command prompt I get a different error like this:
"no items or no numbers defined"
But when I run it from inside the script system it works fine. I suggest you try that.
Maybe that is the problem? Because everything else looks ok.
Re: Moving Static Queue Above Dynamic Queues
Posted: Fri Oct 19, 2007 1:46 am
by mps01k
what version of OS are you running ? i am using 3.0rc5. I just put it into the scripter and it runs but does nothing at all.
can you post an exapmple of exactly how you have it set , that it works for you and not for me?
thanks
Re: Moving Static Queue Above Dynamic Queues
Posted: Sat Dec 01, 2007 9:39 pm
by navibaghdad
Hi
I tried using this script and set the static simple queue priority to 1 but still not effect cause dynamic rule is still move over static.I'm using V3.0rc11 .
any suggestion ?
Re: Moving Static Queue Above Dynamic Queues
Posted: Sun Dec 02, 2007 4:41 pm
by navibaghdad
any one can help us in this problem ???
Re: Moving Static Queue Above Dynamic Queues
Posted: Tue Dec 04, 2007 10:08 am
by Dragonmen
Tried everything some time ago, but i did not suceed.
I think it can't be done.
Re: Moving Static Queue Above Dynamic Queues
Posted: Wed Dec 05, 2007 12:21 am
by navibaghdad
ok what about Mikrotik support ? is there any way to solve this problem ? any script to solve it !!!!
Re: Moving Static Queue Above Dynamic Queues
Posted: Fri Dec 07, 2007 7:53 pm
by maximan
I use this code in a hotspot login script
/queue simple move [find name=cached] 0
to move a particular rule to the topmost position. The script executes fine but rule does not get to position "0". The rule always end up below the dynamic rules.
I can manually move the rule to position "0" in winbox but the script can only move it as far as the dynamic rules. I am using ROS3.0RC5.
You can't use this sintaxis on scripting, use dinamic to find the position
Max
Re: Moving Static Queue Above Dynamic Queues
Posted: Sat Dec 08, 2007 6:52 pm
by mrz
ok what about Mikrotik support ? is there any way to solve this problem ? any script to solve it !!!!
I think Mikrotik have fixed this already in RC11, at least now it works in my case.
Re: Moving Static Queue Above Dynamic Queues
Posted: Sat Dec 08, 2007 8:48 pm
by navibaghdad
ok I'm upgrad to RC11 but its still notwork.can u please post ur conf.
Re: Moving Static Queue Above Dynamic Queues
Posted: Sun Dec 09, 2007 12:05 am
by Dragonmen
RC = not totally stable version (is there sucha thing anyway?) so i don't recommend using it in production environment
Re: Moving Static Queue Above Dynamic Queues
Posted: Mon Dec 10, 2007 5:17 pm
by warwickw
rc = stable if hardware = rb333
RB333 users don't have choice we can only use version 3 release.
Re: Moving Static Queue Above Dynamic Queues
Posted: Fri Dec 14, 2007 2:17 am
by navibaghdad
ok then what is the best solution now ? mrz can u explain how u do it please ?
Re: Moving Static Queue Above Dynamic Queues
Posted: Fri Dec 14, 2007 10:45 am
by mrz
Well.. three queues:
[admin@gw-loc] /queue simple> print
Flags: X - disabled, I - invalid, D - dynamic
0 D name="<hotspot-user1>" target-addresses=10.1.101.225/32
..........
1 D name="hs-<hotspot1>" dst-address=0.0.0.0/0 interface=ether1 parent=none
..........
2 X name="queue1" target-addresses=10.1.101.225/32 dst-address=0.0.0.0/0
..........
Issue command:
/queue simple move [find name="queue1"] 0
and here you go, static queue is above dynamic:
Flags: X - disabled, I - invalid, D - dynamic
0 X name="queue1" target-addresses=10.1.101.225/32 dst-address=0.0.0.0/0
..........
1 D name="<hotspot-user1>" target-addresses=10.1.101.225/32
..........
Re: Moving Static Queue Above Dynamic Queues
Posted: Sun May 11, 2008 4:11 am
by Cyrix
i have the same problem with queues between local network and internet.
does anyone have an idea how to do this when using Radius (user manager, etc...)???
Re: Moving Static Queue Above Dynamic Queues
Posted: Fri Jun 20, 2008 1:06 pm
by Dragonmen
No, the script above don't work if you make script out of it, it work just in console, since you can't print in the script but only in console so it won't work.
As i said it can't be done afaik.
Re: Moving Static Queue Above Dynamic Queues
Posted: Fri Jun 20, 2008 2:03 pm
by mrz
Latest version (3.10) simple script:
/queue simple move [find name="queue1"] 0
Checked all possible ways to execute it ( from terminal, scheduler, netwatch etc.) It works!
Re: Moving Static Queue Above Dynamic Queues
Posted: Fri Jun 20, 2008 5:10 pm
by skillful
Latest version (3.10) simple script:
/queue simple move [find name="queue1"] 0
Checked all possible ways to execute it ( from terminal, scheduler, netwatch etc.) It works!
This does not work with dynamic queues created by user-manager or hotspot. The script cannot move "queue1" above any dynamic queues created by hotspot or user-manager.
Re: Moving Static Queue Above Dynamic Queues
Posted: Sat Jun 21, 2008 1:04 pm
by Dragonmen
Latest version (3.10) simple script:
/queue simple move [find name="queue1"] 0
Checked all possible ways to execute it ( from terminal, scheduler, netwatch etc.) It works!
This does not work with dynamic queues created by user-manager or hotspot. The script cannot move "queue1" above any dynamic queues created by hotspot or user-manager.
Exactly.
Wanted to say that but you were faster.
Re: Moving Static Queue Above Dynamic Queues (FIXED)
Posted: Thu Jul 10, 2008 3:52 pm
by skillful
This issue had been fixed in ROS 3.11. This script
/queue simple move [find name="cached"] 0
now works as expected.
Many thanks to the Mikrotik team for this fix.
Re: Moving Static Queue Above Dynamic Queues
Posted: Sat Aug 02, 2008 11:06 am
by cravetou
Hello
u can u use this script to do what u want automaticlly
:foreach i in=[/queue simple find dynamic=no] do={/queue simple move [/ queue simple get $i name] [/queue simple find dynamic=yes]}
Rafal
Re: Moving Static Queue Above Dynamic Queues (FIXED)
Posted: Thu May 28, 2009 1:30 am
by skillful
This issue had been fixed in ROS 3.11. This script
/queue simple move [find name="cached"] 0
now works as expected.
Many thanks to the Mikrotik team for this fix.
This is broken again in ver3.24!
Re: Moving Static Queue Above Dynamic Queues (FIXED)
Posted: Mon Jun 01, 2009 11:18 am
by skillful
This is broken again in ver3.24!
Any comments on this from the Mikrotik squad?
Re: Moving Static Queue Above Dynamic Queues
Posted: Mon Jun 01, 2009 11:34 am
by mrz
Works for me.
Re: Moving Static Queue Above Dynamic Queues
Posted: Mon Jun 01, 2009 7:49 pm
by skillful
Yes. it works but not with the expected result. Instead of moving the queue to #0, it is moved to the end.
Re: Moving Static Queue Above Dynamic Queues
Posted: Tue Jun 02, 2009 8:26 am
by mrz
If you are checking in winbox, make sure that queues are sorted by the first column
Re: Moving Static Queue Above Dynamic Queues
Posted: Tue Jun 02, 2009 3:15 pm
by skillful
Queues are sorted by the first column. I get the same result in terminal when I issue command "/queue print without-paging"
When downgrade to version 3.23 and the script works as expected.
Re: Moving Static Queue Above Dynamic Queues
Posted: Fri Aug 20, 2010 3:01 am
by GREG3f
Anyone know how to force a static script to be the very last queue in the list. I can do a move command, but I guess I need to know how to find what the last queue is. The reason is, that I wish to use the dynamic queues made by userman, but in case I have other ips that were not generated by userman, I want them treated by a general PCQ rule that limits their speed.
so my command is
/queue simple move [find name=Catchall] 160
But of course the position is always changing.
I tried setting the position to something larger that the actual number of queues, but it always fails.
Re: Moving Static Queue Above Dynamic Queues
Posted: Fri Aug 20, 2010 3:17 am
by fewi
Try something like
/queue simple move [/queue simple find name=catchall] [:len [/simple queue find]]
Re: Moving Static Queue Above Dynamic Queues
Posted: Sat Aug 21, 2010 11:54 pm
by GREG3f
I have tried your suggested code with no success.
/queue simple move [/queue simple find name=catchall] [:len [/queue simple find]]
Queue actually moves to the top [0] position.
Any other suggestions?
Re: Moving Static Queue Above Dynamic Queues
Posted: Thu Oct 17, 2013 6:13 pm
by ahmad210993
there are simple script, just use
/queue simple set [find dynamic] parent=Local (parent local-network you have created)
put in On Login default user profiles in hotspot.
it will put new dynamic hotspot user under your static parent
Re: Moving Static Queue Above Dynamic Queues
Posted: Thu May 22, 2014 12:33 am
by kr4k3n
I use this script run from scheduler...
/queue simple move [find where !dynamic] 0
It works on 5.14 and 6.7 I haven't tried it on anything else yet
correction, it works from terminal command but not from a script.. WTF
Re: Moving Static Queue Above Dynamic Queues
Posted: Sat Jul 19, 2014 11:28 am
by winagain
I managed to get the following to work
/queue simple move [find name="ITEM-TO-BE-MOVED"] 0
by doing this
/queue simple print
/queue simple move [find name="ITEM-TO-BE-MOVED"] 0
It now moves the simple queue to the top as it does in the terminal, I know print is not the best thing to use in scripts however it solved my problem.
Re: Moving Static Queue Above Dynamic Queues
Posted: Sun Sep 06, 2015 5:44 pm
by ravinakarmi
I managed to get the following to work
/queue simple move [find name="ITEM-TO-BE-MOVED"] 0
by doing this
/queue simple print
/queue simple move [find name="ITEM-TO-BE-MOVED"] 0
It now moves the simple queue to the top as it does in the terminal, I know print is not the best thing to use in scripts however it solved my problem.
After trying scripts from top to bottom the only working script is
/queue simple print
/queue simple move [find name="ITEM-TO-BE-MOVED"] 0
Re: Moving Static Queue Above Dynamic Queues
Posted: Tue Oct 11, 2016 4:23 pm
by jayceep14
Hi all,
/queue simple move [find where !dynamic] 0
the above is working on terminal, however if put on the script or scheduler, I put every 20sec interval, the scheduler work but the static queues are not going on top.
My problem is once dynamic queues are created with rate-limit when hotspot users-login the dynamic queues are place in the top and my static queues placed in the bottom making the static queues in the last option which are override by dynamic queues.
anyone can guide me how to make this work, Static queues always on top.
Re: Moving Static Queue Above Dynamic Queues
Posted: Tue Oct 11, 2016 5:00 pm
by ZeroByte
I don't have a Mikrotik in front of me right now to play with, but I think for some features which create dynamic queues, there's the ability to give it a hint on where to place the dynamic queues into the list. (Insert after?)
Re: Moving Static Queue Above Dynamic Queues
Posted: Tue Oct 11, 2016 5:13 pm
by jayceep14
I cant find this option, can you help check
Re: Moving Static Queue Above Dynamic Queues
Posted: Tue Oct 11, 2016 5:51 pm
by ZeroByte
What process is creating the dynamic queues? (Hotspot, PPPoE, VPN, etc)
Re: Moving Static Queue Above Dynamic Queues
Posted: Wed Oct 12, 2016 5:43 am
by jayceep14
Hi ZeroByte,
Dynamic entries are from hotspot
Re: Moving Static Queue Above Dynamic Queues
Posted: Wed Oct 12, 2016 11:50 am
by jayceep14
found already for hotspot, its under Hotspot User Profile
and there as section to insert queue before: first or bottom
Re: Moving Static Queue Above Dynamic Queues
Posted: Wed Oct 12, 2016 1:15 pm
by jayceep14
i notice that the dynamic queues from hotspot with rate-limit are not working anymore when the static queues are on top.
My static entries is on top giving dns priority 1 and http,https priority 2
Re: Moving Static Queue Above Dynamic Queues
Posted: Wed Oct 12, 2016 5:20 pm
by ZeroByte
If you're trying to mix QoS and rate-limiting, then you need to do things differently.
Your QoS queues need to have their targets set to the egress interface (not the IP range).
In general, I find Queue trees to be much more intuitive for QoS.
Try making a queue tree for your WAN interface and setting the appropriate rate limits / priorities for your various packet marks.
Realize that you'll need a tree for the WAN interface and a tree for the LAN interface, since trees only queue traffic that is being egressed - in other words, they only work in one direction.
Re: Moving Static Queue Above Dynamic Queues
Posted: Tue Jan 10, 2017 12:56 pm
by sajibnandi
check using below command,
/queue simple move [find name=queue-Name] [:pick [find] 0]