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

Scenario:

 

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,

cache-1


After HOTSPOT user logged in,

cache-2

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 . . .

cache-final


Some TIPS

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]





Regard’s
Syed Jahanzaib

%d bloggers like this: