Hi all,
I'm looking for a way to set the speed limit by total download usage for each user.
say queue list 192.168.80.16
when Total Rx Bytes at 100MB then Rx Max Limit is 50M Tx Max Limit 10M
when Total Rx Bytes at 500MB then Rx Max Limit is 20M Tx Max Limit 5M
and so on.
when the usage is become heavy, user bandwidth getting less.
big thanks
An
i just noticed at http://wiki.mikrotik.com/wiki/Manual:Scripting-examples have a similar script, but this is for interface bandwidth.
Check bandwidth and add limitations
This script checks if download on interface is more than 512kbps, if true then queue is added to limit speed to 256kbps.
Code:
:foreach i in=[/interface find] do={
/interface monitor-traffic $i once do={
:if ($"received-bits-per-second" > 0 ) do={
:local tmpIP [/ip address get [/ip address find interface=$i] address] ;
# :log warning $tmpIP ;
:for j from=( [:len $tmpIP] - 1) to=0 do={
:if ( [:pick $tmpIP $j] = "/") do={
/queue simple add name=$i max-limit=256000/256000 dst-address=[:pick $tmpIP 0 $j] ;
}
}
}
}
}