tnrclkr
November 15, 2015, 12:17pm
1
Hi all, im setting up a rb750 for a dorm and there will be more than 300 people. i will need to limit them just after they use an amount of data. like
after 10gigs speed will be limited to 4.
15gigs speed will be limited to 2.
20gigs speed will be limited to 1mbit
is there any scripts for this?
:global address
:global usage
:global count 0
/queue simple
remove [find]
:log warning “====================================Run From Schedule====================================” ;
:foreach user in=[/ip hotspot active find ] do={
:set $count ($count + 1);
:set $usage [/ip hotspot active get $user bytes-out] ;
:set $address [/ip hotspot active get $user address] ;
:if ($usage >= 3073741824) do={
add name=$address target=$address limit-at=0/0 max-limit=2M/8M queue=default/default total-queue=default disabled=no;}
}
This is my work for my system, you can change the data value (usage) to suit your need. Work on Version 6.33.5.
Thanks for script but with mine it doesn’t work…version 6.33.5
I made some correction there :
:global address
:global usage
:global count 0
/queue simple
remove [find]
:log warning "====================================Run From Schedule====================================" ;
:foreach user in=[/ip hotspot active find ] do={
:set count ($count + 1);
:set usage [/ip hotspot active get $user bytes-out] ;
:set address [/ip hotspot active get $user address] ;
:if ($usage >= 3073741824) do={
add name=$address target=$address limit-at=0/0 max-limit=2M/8M queue=default/default total-queue=default disabled=no;
}
}
moec
May 19, 2018, 1:31pm
5
Hi lectrapon
I have a similar use case. I am very new at this. Do I need to setup hotspots for each user before running this script? I’m just not sure what I need to do before this.
I have 14 students and would like to limit each to 10GB per month.