Syed Jahanzaib – Personal Blog to Share Knowledge !

November 25, 2013

[Mikrotik Hotspot] Workaround to move Static Queue above Dynamic Queue

Filed under: Mikrotik Related, Uncategorized — Tags: , — Syed Jahanzaib / Pinochio~:) @ 10:37 AM



We have HOTSPOT configured in Mikrotik Routerboard along with SQUID proxy server. Users management is done in ser Manager which creates dynamic queue upon each user login. We have created one simple queue that allows SQUID cache marked packets unlimited speed so that user should get cache at unlimited rate bypassing the internet queue user have. The issue was that when any hotspot user user login and Hotspot/Radius creates Dynamic Queues, and it override our created simple queue of cache by moving itself above the static queue, so the cache-hit queue remain useless to provide unlimited speed to cache packets due to its lower position as things works order wise in the Mikrotik.

As showed in the image below . . .

Before HOTSPOT user login,


After HOTSPOT user logged in,


The workaround for this issue was to add a simple command in the HOTSPOT user profile login section which will moves this static queue name “cache-hit” to 0 (top number) whenever any user login.

The command/script can be added in HOTSPOT > USERS PROFILES > SCRIPTS > On Login section. This way whenever any hotspot user login, this command/script will run, and it will move the cache-hit to 0 number (Top)

Ok first rename your cache hit queue to “cache-hit

Now add cmd/script in HOTSPOT > USERS PROFILES > SCRIPTS > On Login section that will move the cache-hit queue to top. (in this example I have only one default profile, if you have multiple user profiles, you have to add this in all profiles either via CLI, or preferably via GUI )

To move queue based on packet-marks name, use following

/queue simple move [find packet-marks="cache-hit"] 0]

OR to move queue by finding Comments of the queue use following

/queue simple move [find comment ="cache-hit"] 0


Another command format

 /queue simple move [find name="cache-hit"] [:pick [find] 0] 


After adding this cmd, whenever any hotspot user will login , the hotspot profile will execute this cmd & it will move the cache-hit queue to TOP.

Now the results will be as showed in the images below . . .



Move queue before another queue name ‘ZAIB’
/queue simple move [find packet-marks=”YOUTUBE”] destination=ZAIB

To specific Number, like move this queue on number X
/queue simple move [find packet-marks=”YOUTUBE”] [:pick [find] 3]

Move to TOP
/queue simple move [find packet-marks=”YOUTUBE”] 0]

Move Queue by finding its comment

/queue simple move [find comment =”YOUTUBE”] 0

How to remove all dynamic queues [can be used in script login section]

/queue simple remove [find where dynamic]

Syed Jahanzaib


  1. Can we see your script and queue configuration and magle mark stuff ?


    Comment by Ptk — December 6, 2013 @ 9:55 PM

    • hmm I don’t have one as I am not running any or ISP type setup 🙂
      Usually Dynamic queue via Radius is enough 🙂


      Comment by Syed Jahanzaib / Pinochio~:) — December 7, 2013 @ 8:52 AM

      • Today I have a Mikrotik RB450G as my hotspot and a linux with Radius & squid. I would like to pass the squid traffic to the server without be shapped by the queue & limit speed stuff. Same thing for the dns traffic.. today both are shapped by the hotspot queue (I guess).

        Another think, as you are in MIkrotik too, have you done a IPSec thru a EoIP ? cheers


        Comment by Ptk — December 7, 2013 @ 7:54 PM

      • explain further, you want to bypass CACHED packets from the queue ?
        Sorry I have no experience with IPSEC/EOIP


        Comment by Syed Jahanzaib / Pinochio~:) — December 9, 2013 @ 11:02 AM

  2. The cache-hit is going to the last in my case. but when running the same move command from console it goes to the top position.


    Comment by srijitb — August 15, 2014 @ 12:39 PM

  3. hope I’m not interrupting/disturbing you , searching this forum found that you may be such an expert with a heart big enough to help users with a challenging mikrotik issues like me

    I have walled garden ports 993,995,465 for outlook can download yahoo business email & attachments using full line speed (8 MB )without users having to logon to hotspot & it works great, but once a user login email download speed drops down to user’s limit (eg.: 512KB) & it fails many times giving error message (connection to server is interrupted) or (couldn’t download some messages )

    when i disable hotspot or kick the user out or make bindings for a PC it works great but users will use internet with unlimited speed which causes many problems

    I’ve 2 Lines ( real ADSL IPs) divided for 2 IP ranges using NAT mark routing & masquerade, hotspot , DHCP thats all
    realy appreciate any help possible 😦


    Comment by Mahmoud Elbarbary — April 12, 2015 @ 7:50 PM

  4. hi my mikrotik version 6.36
    but not work


    Comment by milad — April 4, 2017 @ 1:28 PM

RSS feed for comments on this post. TrackBack URI

Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

%d bloggers like this: