Community discussions

MikroTik App
 
lovelake
just joined
Topic Author
Posts: 3
Joined: Sat Nov 12, 2016 4:47 pm

User Quota Mamangemt

Sat Nov 12, 2016 4:59 pm

Hello guys,
I have 20 user accounts which are supposed to be valid for 1 year 52w2d. Each user should have 15 GiB as a monthly quota limit and if user exceeds his/her quota rate should be reduced to something like 128k/128k until next month so that total download used will be reset to 0 . So after 12 months accounts expired.

Any help is really appreciated.
thank you in advance :D
Last edited by lovelake on Sun Apr 09, 2017 4:52 pm, edited 1 time in total.
 
lovelake
just joined
Topic Author
Posts: 3
Joined: Sat Nov 12, 2016 4:47 pm

Re: User Quota Mamangemt

Sun Apr 09, 2017 4:51 pm

Any help?!!! :shock: :shock: :shock:
 
AzAel76
just joined
Posts: 17
Joined: Tue Apr 07, 2015 3:08 am

Re: User Quota Mamangemt

Thu May 11, 2017 10:00 am

I run postpaid with monthly quotas by utilizing a bunch of scripts based on those that can be found here https://wiki.mikrotik.com/wiki/AutomatedBilling

You can probably script to update one of the fields in the private information sections of the users profile daily with and incrementing number representing days they have been active and then disable the account when the value exceeds 365..
 
User avatar
ahmedalmi
Frequent Visitor
Frequent Visitor
Posts: 75
Joined: Sat Sep 13, 2014 5:52 pm
Location: sana'a yemen
Contact:

Re: User Quota Mamangemt

Fri May 12, 2017 5:19 am

hello,

create profile in user manager, and limitation, and set group (name of new profile in hotspot user-profile).
of course you must set the validity in profile setting and not set transfer in limitation and nothing in rate-limit

then,
in hotspot user-profile script on-login set this rule:

{
:local upld [:tonum [/tool user-man user get $user upload-used]];
:local downld [:tonum [/tool user-man user get $user download-used]];
:local tr ($upld + $downld);
if ($tr > 16106127360) do={
/queue simple add max-limit=128k/128k name=$user target=$address;
} else {
/queue simple add max-limit=256k/1024k name=$user target=$address;
}
}
:local out [/ip hotspot get 0 interface];
/queue simple remove [find target=$out];

in log-out :
/queue simple remove [find name=$user];


the user will have rate-limit 256k/1024k but if he used the 15GB the rate-limit 128k/128k , you can change it in script if you want.
------
you can see this, it's arabic but you can understand by photos
http://max-upgrade.blogspot.com/2017/01/blog-post.html

Who is online

Users browsing this forum: No registered users and 14 guests