Syed Jahanzaib – Personal Blog to Share Knowledge !

November 20, 2012

Dmasoftlab Radius Manager: Quota Base Service

Filed under: Linux Related, Radius Manager — Tags: , , — Syed Jahanzaib / Pinochio~:) @ 2:13 PM

Scenario # 1 =  1 mbps Speed limit, Fix Monthly Quota Base Service with Daily 300 Mb Download Quota limit, if the user cross the daily quota limit, his service will shift to lower speed profile i.e 256k for the current day, after date change, the user profile will revert back to 1mb.

Details:

Bandwidth Allowed = 1 mb
User Expiry = 1 Month
(after one month, user accounts will expire)
User Monthly Traffic Quota = 1 gbps
(after consuming 1gb total, account will expire)
User Daily Traffic Quota = 300mb
(After downloading 300mb in a day, user service will be changed to NEXT DAILY SERVICE of less speed i.e 256k daily service for the rest of the day. after the date change, user service will be returned to normal i.e 1mb)

Ok here we go . . .

First Create New Service in RM using the following screenshots.

.

===========================================================================

Now create another new service using following screenshots.

.

That’s it. Now When the user will be registered using the user.php, he will first see the below account details.

.

After the user refills his account and purchase credit via user panel, his ID will be ACTIVE with the following info.

.

.

After the user reaches above 300 MB in a single day, his service will be switched to NEXT DAILY SERVICE of zaib-256k-daily.


 

NOTE:

5.x:

The Service change will not be implemented on the FLY for pppoe users because COA is not supported for it. only hotspot users service can be changed on the fly. The pppoe session will be auto disconnected by Mikrotik on radius request, and when it will reconnect , the user will be using 256k service profile.

.

6.x: I noted that with version 6.29 , change on the fly works fine for pppoe as well. in few mikrotik versions, this doesnt works as expected. so i recommend to try 6.29.

Regard’s
Syed Jahanzaib

37 Comments »

  1. Please post more article regarding DMA Radius Manager

    Like

    Comment by tamilmaran — November 20, 2012 @ 9:23 PM

  2. is that available in ‘prepaid card or IAS’? or just available to ‘prepaid regular’ because im try to set in ‘prepaid card or IAS’ but failed.

    Like

    Comment by mohd — January 30, 2013 @ 4:34 AM

    • I am not sure about prepaid. I have only tested it for regular clients/service. I am sure it can work for prepaid too.

      Like

      Comment by Syed Jahanzaib / Pinochio~:) — January 30, 2013 @ 4:16 PM

      • i follow your step but only changed type of service to ‘prepaid or IAS’. user cannot access internet after over limit quota per day because service cannot switch to next daily service. for regular client, it was successfull. thanks for your tutorial. hope u will test for prepaid and IAS then you share the result. thanks agains 🙂

        Like

        Comment by mohd — January 30, 2013 @ 4:44 PM

  3. Hello Syed,
    Great blog for MT/RM etc really appreciate your Knowledge sharing
    Want to know if there is a way we can limit speed according to data usage like for first 10Gb of every monthly cycle speed should be upto 2MB then drop to 256/512Kb

    regards
    Mankomal

    Like

    Comment by Mankomal Singh — June 22, 2013 @ 10:14 AM

    • Yes you can enforce it by using data quota, like if the user use 10gb , his service should be change to lower 256k/512k. Use NEXT MASTER SERVICE OPTION in RM service profile.

      Like

      Comment by Syed Jahanzaib / Pinochio~:) — June 23, 2013 @ 10:53 AM

  4. aslam alekum dear this my cell no 03003338581 and 03337355459 pls i request to u when u online pls chaq my wifi systum a day many time hang on my systum and when electricty of when already jam my systum what is this pls when u online sms me and send to teamviewer pass and chaq this thanks

    Like

    Comment by abdul wahab soomro — August 2, 2013 @ 12:00 PM

    • Sorry brother, I have no experience in wireless field. I work at systems side only.

      Like

      Comment by Syed Jahanzaib / Pinochio~:) — August 3, 2013 @ 10:09 AM

      • i suggest that he puts up a UPS or backup system so that when power goes, his system still remains online. I guess that would be the best option. As power failure is the root coz.

        Like

        Comment by George — August 3, 2013 @ 10:14 AM

  5. I need paid support for special accounting?
    I am using Mikrotik Router OS.
    Everything is working fine except, special accounting.
    Would you like to offer your support?

    Like

    Comment by Inder P. MEEL — February 12, 2014 @ 4:29 PM

  6. I want to limit total traffic (download and upload) for Bronze to be 20GB and Silver to be 50GB.

    I don’t want to edit the user details every time a new user is created. What I want is when the service is applied to the user, then download and upload combined should be 20GB or 50GB depending on the service the user has chosen.

    Like

    Comment by Arthur-Kaye Jnr — April 11, 2014 @ 2:49 PM

    • once a user is created, you should ADD CREDITS (or dposite) in user account manually. This is how billing works, by default new account created is expired (as it should be) and when the user itself reload using refill card or the admin add credits, then the account will be active.

      rest of data limitation is don using service up/down/total bytes.

      Like

      Comment by Syed Jahanzaib / Pinochio~:) — April 11, 2014 @ 10:46 PM

      • If the quota is defined as a service with the limitations then when a user is added the the service is selected for that user would it not automatically pick the limits 20GB or 50Gb

        Like

        Comment by George — April 11, 2014 @ 10:59 PM

  7. Hello Zaib,

    Is there anyway to use max-days in RM. I am using RM 4.0.4 cracked version.

    I mean,
    If I create a service of $10 for 20 days. But the client has $5 as deposit. Can he browse Internet for 10 days?

    Like

    Comment by Arjun Neupane — April 30, 2014 @ 10:53 AM

    • you can create a service with 5$ price and then user can cahnge his service paln to this new service (which will have expiry date of 10 days) and user then can refill using 5$

      Like

      Comment by Syed Jahanzaib / Pinochio~:) — April 30, 2014 @ 1:34 PM

  8. Have you any mikrotik hotspot login page template to use with radius manager?

    Like

    Comment by Sanket Bijlani — May 9, 2014 @ 8:01 PM

  9. Hi Zaib,

    I’m using Radius Manager 4.0.4 and has an issue switching to next service when main service is expired. I have a basic service with no speed limitations but with traffic limited to 50Gb per month. I need a user to be automatically switched to another service without traffic limitations but with speed limited to 256kbps download and 128 kbps upload. I created both services, both of them work. I used a ‘Next expired service’ field of the first service to activate a slow service when user exceeded his 50Gb limit but for some reason the service doesn’t switch. It simply cuts off the internet connection for a user. Any suggestions why does it happen?

    Regards,

    Like

    Comment by Anton — May 16, 2014 @ 4:34 AM

    • What exact version of RM you are using? in few versions, this was the bug that it donot auto switch the NEXT SERVICE.
      in 4.1.5, there is no such issue AFAIK.

      Like

      Comment by Syed Jahanzaib / Pinochio~:) — May 16, 2014 @ 8:20 AM

  10. jahanzaib sir plzzz help me mujko user downloading limit dayna nhi a rahe ma cha raha ho k user 1GB say zada downloading na kr sakay esa ho sakta ..?

    Like

    Comment by FAISAL AHMED — July 4, 2014 @ 7:01 PM

  11. Sir me bhot preshan ho plz kuch krea plzzzzzzzzzzzzzz…

    Like

    Comment by FAISAL AHMED — July 4, 2014 @ 7:04 PM

  12. salam
    man i already configuered my radius with that way
    1GB/day with speed 512/2Mbps and it works great until one week ago
    one week ago my client can download about 8GB/day AND IN FOURTH DAY his card expired
    and same with many other cards 500MB/day and 2GB/day
    what do u think

    Like

    Comment by theaubolgsmmed — November 9, 2015 @ 3:25 AM

  13. Selam Aleykum, After about tariffs created , how can directly provide the user account to be activated . I want to be active with the first usage of the user account after opening the user account . In your above of telling way of user I would draw time is aciliyor as welled , user User.php must also credit loading of , I do not want to be dealing user ‘s interaction with them , olurmusun please help, thank you in advance, best regards.

    Like

    Comment by İsmail Yıldırım — May 24, 2016 @ 12:27 AM

  14. Please post more article regarding DMA Radius Manager and how to change Account Status from expired to Active ?

    Like

    Comment by Khairmohammad — June 16, 2016 @ 5:06 PM

  15. please tell me how to create a customer id in dmasoftlabs

    Like

    Comment by prashanth — December 23, 2016 @ 10:45 AM

  16. Scenario # 1 = 1 mbps Speed limit, Fix Monthly Quota Base Service with monthly 10 gb Download Quota limit, if the user cross the monthly quota limit, his service will shift to lower speed profile i.e 256k for the current month, after month change, the user profile will revert back to 1mb.
    Details:
    Bandwidth Allowed = 1 mb
    User Expiry = 3 Month
    (after 3 month, user accounts will expire)
    User monthly Traffic Quota = 10 gb
    (After downloading 1o gb in a month, user service will be changed to NEXT monthly SERVICE of less speed i.e 256k daily service for the rest of the day. after the date change, user service will be returned to normal i.e 1mb)

    please help for this type service

    Like

    Comment by Rajjak khan — August 6, 2017 @ 1:25 PM

  17. hello i want a self registration with default 1 day 1mbps free package. after registration user can enjoy 1 day free. after time over no more default session allowed for the user. can i create this package?

    Like

    Comment by Md Moshiur Rahman — November 3, 2017 @ 9:30 PM

  18. Hello! I did tried this method it worked well for the day first but didn’t from the next day it should start the same service next day as well!!

    Like

    Comment by broadbandsolutionnp — November 16, 2017 @ 6:09 AM

  19. hello can you help me im using RM 4.1.6 with mikrotik pppoe i use monthly users and when user time expired is disconnected at 12 am and i want to be disconnected at 12 pm can this one be done? thx

    Like

    Comment by Alket Aruci — December 22, 2017 @ 4:33 AM

    • not possible withe DMA in general.
      However if you can do some reverse engineering in it, then Adding Expiration Date for user

      If you want to Expire the Account after XX days, you can use following

      INSERT INTO radcheck ( id , UserName , Attribute , op , Value ) VALUES (NULL , ‘zaib’, ‘Expiration’, ‘=’, ’13 Mar 2016′);
      In above Example User will expires on 13th March, 2016 at 00:00 [Midnight].

      If you want to EXPIRE user at some other specific Time, use following format in time

      INSERT INTO radcheck ( id , UserName , Attribute , op , Value ) VALUES (NULL , ‘zaib’, ‘Expiration’, ‘=’, ’13 Mar 2016 08:00′);

      Like

      Comment by Syed Jahanzaib / Pinochio~:) — December 23, 2017 @ 10:39 PM

      • thank you for all your help

        Like

        Comment by Alket Aruci — December 29, 2017 @ 4:00 AM

  20. Hi M.r I need shared bandwidth with DMA pleas

    Like

    Comment by عبد الحي اسماعيل مصطفى — June 13, 2018 @ 1:39 PM

  21. AOA,Sir how to add Burst time (DL / UL)

    Like

    Comment by shahid — September 29, 2018 @ 5:16 PM


RSS feed for comments on this post. TrackBack URI

Leave a comment