How to limit a user to a given amount of traffic?

I have a simmilar problem. My isp gives me certain volume of data monthly to use, and i want to shape my network to allow my clients (20 of them) to be able to stay within the volume given by my ISP. I have seen this post in the forum and it suits my needs, but am new to scripting. How do i add a scheduler for 5 minutes to this event which you just gave a code for??
Gratefiul for ur response.. timely too

I have a simmilar problem. My isp gives me certain volume of data monthly to use, and i want to shape my network to allow my clients (20 of them) to be able to stay within the volume given by my ISP. I have seen this post in the forum and it suits my needs, but am new to scripting. How do i add a scheduler for 5 minutes to this event which you just gave a code for??
Gratefiul for ur response.. timely too

I have a simmilar problem. My isp gives me certain volume of data monthly to use, and i want to shape my network to allow my clients (20 of them) to be able to stay within the volume given by my ISP. I have seen this post in the forum and it suits my needs, but am unable to see any changes after i specified a limit of 5242880. i want a 5MB download limit…??
Gratefiul for ur response.. timely too

I have a simmilar problem. My isp gives me certain volume of data monthly to use, and i want to shape my network to allow my clients (20 of them) to be able to stay within the volume given by my ISP. I have seen this post in the forum and it suits my needs, but am unable to see any changes after i specified a limit of 5242880. i want a 5MB download limit…??
Gratefiul for ur response.. timely too

I have a simmilar problem. My isp gives me certain volume of data monthly to use, and i want to shape my network to allow my clients (20 of them) to be able to stay within the volume given by my ISP. I have seen this post in the forum and it suits my needs, but am unable to see any changes after i specified a limit of 5242880. i want a 5MB download limit…??
Gratefiul for ur response.. timely too

I have a simmilar problem. My isp gives me certain volume of data monthly to use, and i want to shape my network to allow my clients (20 of them) to be able to stay within the volume given by my ISP. I have seen this post in the forum and it suits my needs, but am unable to see any changes after i specified a limit of 5242880. i want a 5MB download limit…??
Gratefiul for ur response.. timely too

i have implemented this rule in my schedule, but somehow, when the total bytes transferred gets to 5MB, the schedule does not take the upload/download to 16000/32000… Is there anything else i need to do?
this is my configuration..

/queue simple
:for i from=1 to= 254 do = {
:if ([/queue simple find target-addresses=(“192.168.1.” . $i)] != “”) do={
:set traf [get [find target-addresses=(“192.168.1.” . $i)] total-bytes]
:if ($traf > 5242880) do = {
set [find target-addresses=(“192.168.1.” . $i)] max-limit= 16000/32000
}
}
}

Hi, I am not a programmer and have never attempted any script in my entire life. I don’t know how to do it correctly. Will the following work???
Scripts


add name=shapingRate source={
:local traf;
/queue simple
:for i from=1 to= 254 do = {
:if ([/queue simple find target-addresses=(“192.168.1.” . $i)] != “”) do={
:set traf [get [find target-addresses=(“192.168.1.” . $i)] total-bytes]
:if ($traf > 104857600) do = {
set [find target-addresses=(“192.168.1.” . $i)] max-limit= 32000/64000
}
}
}

}

add name=resetCounter source={/que simple reset-counters}


Schedules


add name=run-1h interval=1h on-event=shapingRate
add name=run-24h interval=24h on-event=resetCounter

I 2 have tried this script and have even set the limits way low like 60K and users are suppose to be down to like 10k both ways but I dont see this rule being applied…all my clients have ip starting in the 10.5.50 range so I changed to these settings in the script. Any long awaited input would be great here… this compatible with 2.9.43?

Just an update, this script works great, just takes a few minutes after the limits have been attained in order for the changes to take affect… Thx

k, again an update, the script seems to change the max target upload and download as per code, but, the breaks dont seems to be applied at all. In the queue, those that went over there limits got there max targets changed, but they still download at there normal max speeds and not the showed changed values..

Any input from script coders would be great pls… I have to slow these guys down once they reach there peak, there costing me a fortune.. lol

any help please, almost desperate here. lol

Does this work for usermanager accounts?

Good day.
Forgive me for assistance.
I need to ask RADIUS- users to limit the traffic that they can get through the hotspot. Through RADIUS attributes and Mikrotik-Recv-Limit Mikrotik-Xmit-Limit not produced, wrote about it in this forum, there is no answer yet: (. As a temporary option would impose a limitation on traffic through a script in the profile authorization. Should not difficult, please give an example of a script for a profile authorization implementing the restriction limit traffic in the 5 Megabytes.
PS I know, in your user item regarding limit traffic there, but I have not opened to users RouterOS and recorded via RADIUS
Please Help.
Sorry for the poor English.

Here i1s my plan. Let me know if…what i am missing.

First set it up for transparent traffic shaping:


/ interface bridge
add name=“bridge1”
/ interface bridge port
add interface=ether bridge=bridge1
add interface=ether3 bridge=bridge1
/ interface bridge settings
set use-ip-firewall=yes

/ ip firewall mangle
add chain=prerouting action=mark-connection new-connection-mark=other_conn
passthrough=yes
add chain=prerouting connection-mark=other_conn action=mark-packet
new-packet-mark=other passthrough=no

/ queue simple
add name=“other” parent=main packet-marks=other max-limit=100000000/100000000


\



This script will check all the simple queues searching their target addresses and will search

10.100-103
10.151-179
10.810-189
10.140
10.150.0.1-10.150.63.255

(or i could put it on the outside interface and just have to go though a single class b, i may have to do that anyways with trunking and all…)

subnet. It will read their total-bytes (received transmitted) and will check them if they crossed a limit of
500 MB ( 524288000 bytes) If they did , they will be limited to lower speed (64k/64k).

I will put this on a scheduler that will run the script every 5 minutes from 18:00 to 23:55pm every day.

/system script
add name=start_limit source={/system scheduler name=limiter_timer start-time=18:00:00 interval=5m script=limiter}
add name=stop_limit source={!!!!How do i remove the scheduler?... I have yet to buy/ever use microTik but will the moment once I get the hardware I plan to use. The PC I bought has a sata controller not supported so I have ordered another.  Something like "/system scheduler remove limiter_timer" is my guess

/que simple reset-counters

}

/ system scheduler
add name=start_limit_script start-time=18:00:00 interval=24h script=start_limit
add name=stop_limit_script start-time=23:25:00 interval=24h script=stop_limit



/system script limiter  {
:local traf;
/queue simple
{
  :for i from=1 to= 254 do =  {
    :if ([/queue simple find target-addresses=("10.100.1." . $i)] != "") do={
      :set traf [get [find target-addresses=("10.100.1." . $i)] total-bytes]
      :if ($traf  > 524288000) do = {
        set [find target-addresses=("10.100.1." . $i)] max-limit= 32000/64000
      }
    }
  }
  :for i from=1 to= 254 do =  {
    :if ([/queue simple find target-addresses=("10.101.1." . $i)] != "") do={
      :set traf [get [find target-addresses=("10.101.1." . $i)] total-bytes]
      :if ($traf  > 524288000) do = {
        set [find target-addresses=("10.101.1." . $i)] max-limit= 32000/64000
      }
    }
  }
  :for i from=1 to= 254 do =  {
    :if ([/queue simple find target-addresses=("10.102.1." . $i)] != "") do={
      :set traf [get [find target-addresses=("10.102.1." . $i)] total-bytes]
      :if ($traf  > 524288000) do = {
        set [find target-addresses=("10.102.1." . $i)] max-limit= 32000/64000
      }
    }
  }
  :for i from=1 to= 254 do =  {
    :if ([/queue simple find target-addresses=("10.103.1." . $i)] != "") do={
      :set traf [get [find target-addresses=("10.103.1." . $i)] total-bytes]
      :if ($traf  > 524288000) do = {
        set [find target-addresses=("10.103.1." . $i)] max-limit= 32000/64000
      }
    }
  }
  :for i from=1 to= 254 do =  {
    :if ([/queue simple find target-addresses=("10.151.1." . $i)] != "") do={
      :set traf [get [find target-addresses=("10.151.1." . $i)] total-bytes]
      :if ($traf  > 524288000) do = {
        set [find target-addresses=("10.151.1." . $i)] max-limit= 32000/64000
      }
    }
  }
  :for i from=1 to= 254 do =  {
    :if ([/queue simple find target-addresses=("10.152.1." . $i)] != "") do={
      :set traf [get [find target-addresses=("10.152.1." . $i)] total-bytes]
      :if ($traf  > 524288000) do = {
        set [find target-addresses=("10.152.1." . $i)] max-limit= 32000/64000
      }
    }
  }
  :for i from=1 to= 254 do =  {
    :if ([/queue simple find target-addresses=("10.153.1." . $i)] != "") do={
      :set traf [get [find target-addresses=("10.153.1." . $i)] total-bytes]
      :if ($traf  > 524288000) do = {
        set [find target-addresses=("10.153.1." . $i)] max-limit= 32000/64000
      }
    }
  }
  :for i from=1 to= 254 do =  {
    :if ([/queue simple find target-addresses=("10.154.1." . $i)] != "") do={
      :set traf [get [find target-addresses=("10.154.1." . $i)] total-bytes]
      :if ($traf  > 524288000) do = {
        set [find target-addresses=("10.154.1." . $i)] max-limit= 32000/64000
      }
    }
  }
  :for i from=1 to= 254 do =  {
    :if ([/queue simple find target-addresses=("10.155.1." . $i)] != "") do={
      :set traf [get [find target-addresses=("10.155.1." . $i)] total-bytes]
      :if ($traf  > 524288000) do = {
        set [find target-addresses=("10.155.1." . $i)] max-limit= 32000/64000
      }
    }
  }
  :for i from=1 to= 254 do =  {
    :if ([/queue simple find target-addresses=("10.156.1." . $i)] != "") do={
      :set traf [get [find target-addresses=("10.156.1." . $i)] total-bytes]
      :if ($traf  > 524288000) do = {
        set [find target-addresses=("10.156.1." . $i)] max-limit= 32000/64000
      }
    }
  }
  :for i from=1 to= 254 do =  {
    :if ([/queue simple find target-addresses=("10.157.1." . $i)] != "") do={
      :set traf [get [find target-addresses=("10.157.1." . $i)] total-bytes]
      :if ($traf  > 524288000) do = {
        set [find target-addresses=("10.157.1." . $i)] max-limit= 32000/64000
      }
    }
  }
  :for i from=1 to= 254 do =  {
    :if ([/queue simple find target-addresses=("10.158.1." . $i)] != "") do={
      :set traf [get [find target-addresses=("10.158.1." . $i)] total-bytes]
      :if ($traf  > 524288000) do = {
        set [find target-addresses=("10.158.1." . $i)] max-limit= 32000/64000
      }
    }
  }
  :for i from=1 to= 254 do =  {
    :if ([/queue simple find target-addresses=("10.159.1." . $i)] != "") do={
      :set traf [get [find target-addresses=("10.159.1." . $i)] total-bytes]
      :if ($traf  > 524288000) do = {
        set [find target-addresses=("10.159.1." . $i)] max-limit= 32000/64000
      }
    }
  }
  :for i from=1 to= 254 do =  {
    :if ([/queue simple find target-addresses=("10.160.1." . $i)] != "") do={
      :set traf [get [find target-addresses=("10.160.1." . $i)] total-bytes]
      :if ($traf  > 524288000) do = {
        set [find target-addresses=("10.160.1." . $i)] max-limit= 32000/64000
      }
    }
  }
  :for i from=1 to= 254 do =  {
    :if ([/queue simple find target-addresses=("10.161.1." . $i)] != "") do={
      :set traf [get [find target-addresses=("10.161.1." . $i)] total-bytes]
      :if ($traf  > 524288000) do = {
        set [find target-addresses=("10.161.1." . $i)] max-limit= 32000/64000
      }
    }
  }
  :for i from=1 to= 254 do =  {
    :if ([/queue simple find target-addresses=("10.162.1." . $i)] != "") do={
      :set traf [get [find target-addresses=("10.162.1." . $i)] total-bytes]
      :if ($traf  > 524288000) do = {
        set [find target-addresses=("10.162.1." . $i)] max-limit= 32000/64000
      }
    }
  }
  :for i from=1 to= 254 do =  {
    :if ([/queue simple find target-addresses=("10.163.1." . $i)] != "") do={
      :set traf [get [find target-addresses=("10.163.1." . $i)] total-bytes]
      :if ($traf  > 524288000) do = {
        set [find target-addresses=("10.163.1." . $i)] max-limit= 32000/64000
      }
    }
  }
  :for i from=1 to= 254 do =  {
    :if ([/queue simple find target-addresses=("10.164.1." . $i)] != "") do={
      :set traf [get [find target-addresses=("10.164.1." . $i)] total-bytes]
      :if ($traf  > 524288000) do = {
        set [find target-addresses=("10.164.1." . $i)] max-limit= 32000/64000
      }
    }
  }
  :for i from=1 to= 254 do =  {
    :if ([/queue simple find target-addresses=("10.165.1." . $i)] != "") do={
      :set traf [get [find target-addresses=("10.165.1." . $i)] total-bytes]
      :if ($traf  > 524288000) do = {
        set [find target-addresses=("10.165.1." . $i)] max-limit= 32000/64000
      }
    }
  }
  :for i from=1 to= 254 do =  {
    :if ([/queue simple find target-addresses=("10.166.1." . $i)] != "") do={
      :set traf [get [find target-addresses=("10.166.1." . $i)] total-bytes]
      :if ($traf  > 524288000) do = {
        set [find target-addresses=("10.1.166." . $i)] max-limit= 32000/64000
      }
    }
  }
  :for i from=1 to= 254 do =  {
    :if ([/queue simple find target-addresses=("10.167.1." . $i)] != "") do={
      :set traf [get [find target-addresses=("10.167.1." . $i)] total-bytes]
      :if ($traf  > 524288000) do = {
        set [find target-addresses=("10.167.1." . $i)] max-limit= 32000/64000
      }
    }
  }
  :for i from=1 to= 254 do =  {
    :if ([/queue simple find target-addresses=("10.168.1." . $i)] != "") do={
      :set traf [get [find target-addresses=("10.168.1." . $i)] total-bytes]
      :if ($traf  > 524288000) do = {
        set [find target-addresses=("10.168.1." . $i)] max-limit= 32000/64000
      }
    }
  }
  :for i from=1 to= 254 do =  {
    :if ([/queue simple find target-addresses=("10.169.1." . $i)] != "") do={
      :set traf [get [find target-addresses=("10.169.1." . $i)] total-bytes]
      :if ($traf  > 524288000) do = {
        set [find target-addresses=("10.169.1." . $i)] max-limit= 32000/64000
      }
    }
  }
  :for i from=1 to= 254 do =  {
    :if ([/queue simple find target-addresses=("10.170.1." . $i)] != "") do={
      :set traf [get [find target-addresses=("10.170.1." . $i)] total-bytes]
      :if ($traf  > 524288000) do = {
        set [find target-addresses=("10.170.1." . $i)] max-limit= 32000/64000
      }
    }
  }
  :for i from=1 to= 254 do =  {
    :if ([/queue simple find target-addresses=("10.171.1." . $i)] != "") do={
      :set traf [get [find target-addresses=("10.171.1." . $i)] total-bytes]
      :if ($traf  > 524288000) do = {
        set [find target-addresses=("10.171.1." . $i)] max-limit= 32000/64000
      }
    }
  }
  :for i from=1 to= 254 do =  {
    :if ([/queue simple find target-addresses=("10.172.1." . $i)] != "") do={
      :set traf [get [find target-addresses=("10.172.1." . $i)] total-bytes]
      :if ($traf  > 524288000) do = {
        set [find target-addresses=("10.172.1." . $i)] max-limit= 32000/64000
      }
    }
  }
  :for i from=1 to= 254 do =  {
    :if ([/queue simple find target-addresses=("10.173.1." . $i)] != "") do={
      :set traf [get [find target-addresses=("10.173.1." . $i)] total-bytes]
      :if ($traf  > 524288000) do = {
        set [find target-addresses=("10.173.1." . $i)] max-limit= 32000/64000
      }
    }
  }
  :for i from=1 to= 254 do =  {
    :if ([/queue simple find target-addresses=("10.174.1." . $i)] != "") do={
      :set traf [get [find target-addresses=("10.174.1." . $i)] total-bytes]
      :if ($traf  > 524288000) do = {
        set [find target-addresses=("10.174.1." . $i)] max-limit= 32000/64000
      }
    }
  }
  :for i from=1 to= 254 do =  {
    :if ([/queue simple find target-addresses=("10.175.1." . $i)] != "") do={
      :set traf [get [find target-addresses=("10.175.1." . $i)] total-bytes]
      :if ($traf  > 524288000) do = {
        set [find target-addresses=("10.175.1." . $i)] max-limit= 32000/64000
      }
    }
  }
  :for i from=1 to= 254 do =  {
    :if ([/queue simple find target-addresses=("10.176.1." . $i)] != "") do={
      :set traf [get [find target-addresses=("10.176.1." . $i)] total-bytes]
      :if ($traf  > 524288000) do = {
        set [find target-addresses=("10.176.1." . $i)] max-limit= 32000/64000
      }
    }
  }
  :for i from=1 to= 254 do =  {
    :if ([/queue simple find target-addresses=("10.177.1." . $i)] != "") do={
      :set traf [get [find target-addresses=("10.177.1." . $i)] total-bytes]
      :if ($traf  > 524288000) do = {
        set [find target-addresses=("10.177.1." . $i)] max-limit= 32000/64000
      }
  :for i from=1 to= 254 do =  {
    :if ([/queue simple find target-addresses=("10.178.1." . $i)] != "") do={
      :set traf [get [find target-addresses=("10.178.1." . $i)] total-bytes]
      :if ($traf  > 524288000) do = {
        set [find target-addresses=("10.178.1." . $i)] max-limit= 32000/64000
      }
    }
  }  
  :for i from=1 to= 254 do =  {
    :if ([/queue simple find target-addresses=("10.179.1." . $i)] != "") do={
      :set traf [get [find target-addresses=("10.179.1." . $i)] total-bytes]
      :if ($traf  > 524288000) do = {
        set [find target-addresses=("10.179.1." . $i)] max-limit= 32000/64000
      }
    }
  } 
  :for i from=1 to= 254 do =  {
    :if ([/queue simple find target-addresses=("10.181.1." . $i)] != "") do={
      :set traf [get [find target-addresses=("10.181.1." . $i)] total-bytes]
      :if ($traf  > 524288000) do = {
        set [find target-addresses=("10.181.1." . $i)] max-limit= 32000/64000
      }
    }
  }
  :for i from=1 to= 254 do =  {
    :if ([/queue simple find target-addresses=("10.182.1." . $i)] != "") do={
      :set traf [get [find target-addresses=("10.182.1." . $i)] total-bytes]
      :if ($traf  > 524288000) do = {
        set [find target-addresses=("10.182.1." . $i)] max-limit= 32000/64000
      }
    }
  }
  :for i from=1 to= 254 do =  {
    :if ([/queue simple find target-addresses=("10.183.1." . $i)] != "") do={
      :set traf [get [find target-addresses=("10.183.1." . $i)] total-bytes]
      :if ($traf  > 524288000) do = {
        set [find target-addresses=("10.183.1." . $i)] max-limit= 32000/64000
      }
    }
  }
  :for i from=1 to= 254 do =  {
    :if ([/queue simple find target-addresses=("10.184.1." . $i)] != "") do={
      :set traf [get [find target-addresses=("10.184.1." . $i)] total-bytes]
      :if ($traf  > 524288000) do = {
        set [find target-addresses=("10.184.1." . $i)] max-limit= 32000/64000
      }
    }
  }
  :for i from=1 to= 254 do =  {
    :if ([/queue simple find target-addresses=("10.185.1." . $i)] != "") do={
      :set traf [get [find target-addresses=("10.185.1." . $i)] total-bytes]
      :if ($traf  > 524288000) do = {
        set [find target-addresses=("10.185.1." . $i)] max-limit= 32000/64000
      }
    }
  }
  :for i from=1 to= 254 do =  {
    :if ([/queue simple find target-addresses=("10.186.1." . $i)] != "") do={
      :set traf [get [find target-addresses=("10.186.1." . $i)] total-bytes]
      :if ($traf  > 524288000) do = {
        set [find target-addresses=("10.186.1." . $i)] max-limit= 32000/64000
      }
    }
  }
  :for i from=1 to= 254 do =  {
    :if ([/queue simple find target-addresses=("10.187.1." . $i)] != "") do={
      :set traf [get [find target-addresses=("10.187.1." . $i)] total-bytes]
      :if ($traf  > 524288000) do = {
        set [find target-addresses=("10.187.1." . $i)] max-limit= 32000/64000
      }
    }
  }
  :for i from=1 to= 254 do =  {
    :if ([/queue simple find target-addresses=("10.188.1." . $i)] != "") do={
      :set traf [get [find target-addresses=("10.188.1." . $i)] total-bytes]
      :if ($traf  > 524288000) do = {
        set [find target-addresses=("10.188.1." . $i)] max-limit= 32000/64000
      }
    }
  }
  :for i from=1 to= 254 do =  {
    :if ([/queue simple find target-addresses=("10.189.1." . $i)] != "") do={
      :set traf [get [find target-addresses=("10.189.1." . $i)] total-bytes]
      :if ($traf  > 524288000) do = {
        set [find target-addresses=("10.189.1." . $i)] max-limit= 32000/64000
      }
    }
  }
  :for i from=1 to= 254 do =  {
    :if ([/queue simple find target-addresses=("10.140.1." . $i)] != "") do={
      :set traf [get [find target-addresses=("10.140.1." . $i)] total-bytes]
      :if ($traf  > 524288000) do = {
        set [find target-addresses=("10.140.1." . $i)] max-limit= 32000/64000
      }
    }
  }
  :for i from=1 to= 254 do =  {
    :for j from=0 to= 63 do =  {
      :if ([/queue simple find target-addresses=("10.150." . $j . "." . $i)] != "") do={
        :set traf [get [find target-addresses=("10.150.1." . $i)] total-bytes]
        :if ($traf  > 524288000) do = {
          set [find target-addresses=("10.150.1." . $i)] max-limit= 32000/64000
        }
      }
    }
  }
}
}

at 24:00 I will add script in the scheduler to reset the counters and lift any limits.
/que simple reset-counters
Do I need to go though every address and remove/increase the max-limit as well?

My Script was working normally for shaping the amount of traffic on 2.9.51 .. but after upgrading to 4.10 the script stops working ..


:local traf;
/queue simple
:for i from=1 to= 254 do = {
:if ([/queue simple find target-addresses=(“10.11.2.” . $i)] != “”) do={
:set traf [get [find target-addresses=(“10.11.2.” . $i)] total-bytes]
:if ($traf <104857600) do = {
set [find target-addresses=(“10.11.2.” . $i)] max-limit=16000/64000 limit-at=16000/64000 burst-limit=24000/80000 burst-threshold=16000/64000 burst-time=10s/10s
}
}
}


Any idea guys why this happens!!

The script it doesn’t working for me as well, i did created scheduler running in every 5 minutes and doing a counter rest in every 24 hour.

This is my script which my IP address range in between 192.168.88.*

Name : > shapingRate

:local traf;
/queue simple
:for i from= 1 to= 254 do = {
:if ([/queue simple find target-addresses=(“192.168.88.” . $i)] != “”) do={
:set traf [get [find target-addresses=(“192.168.88.” . $i)] total-bytes]
:if ($traf > 10485760) do = {
set [find target-addresses=(“192.168.88.” . $i)] max-limit= 10240/10240
}
}
}

And this is my scheduler

Name : > run-1h

/que simple reset-counters



Name : > run-24h

resetCounter

This is my script:

/queue simple; :foreach i in=[find] \
do={  \
     :set sqName [get $i name]; \
#     :set sqTotalAvgRate [get $i total-avg-rate]; \
     :set sqTotalBytes [get $i total-bytes]; \
     :set sqLevel [:find $sqName "\[BASE-R\]"]; \
     :if ($sqLevel >= 0)  do={ \
        set $i max-limit=256K/10M; \
        :if ($sqTotalBytes  > 104857)  do = { \
          set $i max-limit=256K/1280K; \
        }; \
     } else {
       :set sqLevel [:find $sqName "\[STANDARD-R\]"]; \
       :if ($sqLevel >= 0)  do={ \
           set $i max-limit=256K/10M; \
           :if ($sqTotalBytes  > (2 * 104857600))  do = { \
             set $i max-limit=256K/2304K; \
           }; \
       } else { \
           :set sqLevel [:find $sqName "\[PLUS-R\]"]; \
           :if ($sqLevel >= 0)  do={ \
               set $i max-limit=512K/10M; \
               :if ($sqTotalBytes  > (3 * 104857600))  do = { \
                  set $i max-limit=512K/3M; \
                }; \
	} else {
       :set sqLevel [:find $sqName "\[TOP-R\]"]; \
       :if ($sqLevel >= 0)  do={ \
           set $i max-limit=512K/10M; \
           :if ($sqTotalBytes  > (2 * 104857600))  do = { \
             set set $i max-limit=512K/4M; \
           }; \
	} else {
       :set sqLevel [:find $sqName "\[EXTREME-R\]"]; \
       :if ($sqLevel >= 0)  do={ \
           set $i max-limit=1M/10M; \
           :if ($sqTotalBytes  > (2 * 104857600))  do = { \
             set set $i max-limit=1M/7M; \
           }; \
	} else {
       :set sqLevel [:find $sqName "\[BASE-B\]"]; \
       :if ($sqLevel >= 0)  do={ \
           set $i max-limit=256K/10M; \
           :if ($sqTotalBytes  > (2 * 104857600))  do = { \
             set $i max-limit=256K/1280K; \
           }; \
	} else {
       :set sqLevel [:find $sqName "\[STANDARD-B\]"]; \
       :if ($sqLevel >= 0)  do={ \
           set $i max-limit=320K/10M; \
           :if ($sqTotalBytes  > (2 * 104857600))  do = { \
             set set $i max-limit=320K/2304k; \
           }; \
	} else {
       :set sqLevel [:find $sqName "\[TOP-B\]"]; \
       :if ($sqLevel >= 0)  do={ \
           set $i max-limit=512k/10M; \
           :if ($sqTotalBytes  > (2 * 104857600))  do = { \
             set set $i max-limit=512K/4M; \
           }; \
	} else {
       :set sqLevel [:find $sqName "\[EXTEME-B\]"]; \
       :if ($sqLevel >= 0)  do={ \
           set $i max-limit=1M/10M; \
           :if ($sqTotalBytes  > (2 * 104857600))  do = { \
             set set $i max-limit=1M/7M; \
           }; \
                }; \
                }; \
     }; \
     :if ($sqLevel >= 0) do { \
        :put ([get $i name] . " : " . [get $i limit-at] . " : " . [get $i max-limit]  . " : " . [get $i burst-limit]   . " : " . [get $i burst-threshold]  . " : " . [get $i burst-time]) ; \
     }; \
}

in 5.25 it doesnt work

can someone help me ?

I have managed to let it work but I am not able to read total bytes since in my queue the total statistics of the queue remains to 0.

how can I let it populate correctly?
Also I will be interested only in checking 1GB of download traffic..

Hi, i want to reset only the total-bytes counter not all. how can i do that?