freeradius accounting off based on time
On 20/09/12 14:43, Mohsen Saeedi wrote:
Hi I'm using chillispot with freeradius. i wrote a perl module for user traffic accounting with freeradius sql module to limit users total traffic at the month or at the week. i defined a few attribute fot this purpose. and the question is : I need to enable a free traffic for all user at the specific time. for example from 22:00 to 06:00. how can i enable it for our users? we don't want to calculate this free traffic in the user total traffic and it should free at the specific time.
This isn't easy. RADIUS accounting packets contain the *total* amount of traffic up until that point, so you'll need to do some work. Basically, for each accounting packet you'll have to subtract the *previous* packets byte values. Then during your "free" period, do nothing, and during your "charged" period, add the delta to the users quota usage. It won't be exact - you can't control the arrival time of accounting packets, only suggest an interval, so you might count a few minutes either side of when you want. It will be quite a bit of work, and you'll need to be familiar with SQL (or whatever you store your accounting) as well as FreeRADIUS.
Hi Mohsen , I think there are several ways to do that but the quickest solution is to do log users traffic in another table(clone of your original table) or DB during that period of time.this solution might not be the exact quick solution but the idea may help you. there are ofcourse permanent and temporary solutions for that issue too. Sianoosh (friend of Nima) On Sep 20, 2012 1:50 PM, "Mohsen Saeedi" <mohsen.saeedi@gmail.com> wrote:
Hi I'm using chillispot with freeradius. i wrote a perl module for user traffic accounting with freeradius sql module to limit users total traffic at the month or at the week. i defined a few attribute fot this purpose. and the question is : I need to enable a free traffic for all user at the specific time. for example from 22:00 to 06:00. how can i enable it for our users? we don't want to calculate this free traffic in the user total traffic and it should free at the specific time. thanks.
- List info/subscribe/unsubscribe? See http://www.freeradius.org/list/users.html
Dear, i believe that isn't a features of freeradius but is a sofware implementation on you NAS. if your nas is mikrotik, Mikrotik-Address-List + PCQ + Mangle is the way to do your work, standard Mik rate limit cannot do that your boss ask. Good job On Sat, 2012-09-22 at 03:33 -0400, Sianoosh wrote:
Hi Mohsen , I think there are several ways to do that but the quickest solution is to do log users traffic in another table(clone of your original table) or DB during that period of time.this solution might not be the exact quick solution but the idea may help you. there are ofcourse permanent and temporary solutions for that issue too.
Sianoosh (friend of Nima)
On Sep 20, 2012 1:50 PM, "Mohsen Saeedi" <mohsen.saeedi@gmail.com> wrote: Hi I'm using chillispot with freeradius. i wrote a perl module for user traffic accounting with freeradius sql module to limit users total traffic at the month or at the week. i defined a few attribute fot this purpose. and the question is : I need to enable a free traffic for all user at the specific time. for example from 22:00 to 06:00. how can i enable it for our users? we don't want to calculate this free traffic in the user total traffic and it should free at the specific time. thanks.
- List info/subscribe/unsubscribe? See http://www.freeradius.org/list/users.html - List info/subscribe/unsubscribe? See http://www.freeradius.org/list/users.html
-- Giuseppe Marocchio Tel: (+39) 045.8538888 http://www.marocchio.com skype: giuseppe.marocchio **** Riservatezza / Confidentiality **** In ottemperanza al D.L. n. 196 del 30/6/2003 in materia di protezione dei dati personali, le informazioni contenute in questo messaggio sono strettamente riservate ed esclusivamente indirizzate al destinatario indicato (oppure alla persona responsabile di rimetterlo al destinatario). Vogliate tener presente che qualsiasi uso, riproduzione o divulgazione di questo messaggio è vietato. Nel caso in cui aveste ricevuto questo messaggio per errore, vogliate cortesemente avvertire il mittente e distruggere il presente messaggio.
participants (4)
-
Giuseppe Marocchio -
Mohsen Saeedi -
Phil Mayers -
Sianoosh