Someone asked me about hotspot related issue . The scenario was that HOTSPOT was configured with SQUID proxy server. He also had User Manager so queuing is dynamically managed by user manager in hotspot. He had simple queue to provide cache hit marked packets unlimited speed to users. The issue was that when any hotspot user user login and Hotspot/Radius creates Dynamic Queues, and it override simple queue by moving itself above the static queue, so the cache-hit queue remain useless to provide unlimited speed to cache packets dueto its lower position.
As showed in the image below . . .
Before HOTSPOT user login,
After HOTSPOT user logged in,
The workaround for this issue was to create a script that moves this static queue name “cache-hit” to 0 (top number) whenever any user login.
The scripts can be added in HOTSPOT > USERS PROFILES > SCRIPTS.
This way whenever any hotspot user login, this 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 a script that will do actually move the cache-hit queue to top. [FOR MIKROTIK 5.X]
/system script add name=movestatic0 policy=\ ftp,reboot,read,write,policy,test,winbox,password,sniff,sensitive,api \ source=/queue simple move [find name=\cache-hit\] 0
Now we have to add this script in the HOTSPOT user profiles (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 )
[FOR MIKROTIK 5.X]
/ip hotspot user profile set [ find default=yes ] idle-timeout=none keepalive-timeout=2m name=default \ on-login=/system script run movestatic0 shared-users=1 \ status-autorefresh=1m transparent-proxy=no
FOR MIKROTIK 6.X USE THIS [UPDATED ON 25th AUGUST, 2014 11:00PM]
/queue simple move [find name="cache-hit"] [:pick [find] 0]
Now whenever any hotspot user will login , the hotspot profile will execute the script “movestatic0” that we created earlier, and it will move the cache-hit queue to TOP.
Now the results will be as showed in the images below . . .
Move queue befote this queue name ZAIB
/queue simple move [find packet-marks=”YOUTUBE”] destination=ZAIB
To specific Number
/queue simple move [find packet-marks=”YOUTUBE”] [:pick [find] 3]
Move to TOP
/queue simple move [find packet-marks=”YOUTUBE”] 0]