FR 3.0.x Head + coova chilli + mysql Volume Limit
Russell Mike
radius.sir at gmail.com
Thu Oct 16 18:55:40 CEST 2014
it is due to check item, check item that deny on re login. it is something
very little.
*Cross Check: *
1.) Write down your data limit as one 64 bit number. Or use python script
to generate upper / lower number(s)
2.) Put lower 32bit number in *Octets attribute* and Uper 32bit number
in *Gigawords
attribute* as reply items. - Reply Item Used For Disconnection- *Already
Working !!!!!!!*
3.) Create Max-All-MB RLM_SQL counter
sqlcounter *chillispot_max_all_mb *{
counter-name = "Download-Limit-MB"
check-name = "Max-All-MB"
reply-name = "Session-Timeout"
reply-message = "You have reached your bandwidth limit"
sqlmod-inst = "sql"
key = "User-Name"
reset = "never"
cache-size = 5000
query = "SELECT SUM(AcctInputOctets) / (1024*1024) +
SUM(AcctOutputOctets) / (1024*1024) FROM radacct WH$
}
4.) Add Max-All-MB attributes in dictionary file
nano /usr/share/freeradius/dictionary.chilli
ATTRIBUTE Max-All-MB 3008 integer (if 3008 is
already occupied use 3009 4009 etc..)
5.) Specify check item as "Max-All-MB" attributes - for example 6GB =
6144MB Check-Item Prevent Re Login *Not Working !!!!!!*
6.) User should be part of this Freeraidus Group (Profile), where you have
added those check and reply attributes attached
*I suspect the problem in step 7. *
7.)
Add "chillispot_max_all_mb" in /etc/freeradius/radiusd.conf under instantiate
section
instantiate {
chillispot_max_all_mb
more entries..
7a.) Add "chillispot_max_all_mb" /etc/freeradius/sites-available/default
in authorize section
authorize {
chillispot_max_all_mb
more entries..
Keep on trying Would work.
Thanks RM--
On Thu, Oct 16, 2014 at 1:12 PM, Abdullah <b.hawks123 at gmail.com> wrote:
> yes have done both those steps
> cant really see what am i missing? :/
> users gets disconnected alrighjt but doesnt prvent relogin
>
> On Thu, Oct 16, 2014 at 12:11 PM, Russell Mike <radius.sir at gmail.com>
> wrote:
>
>> Hi Abdullah
>>
>> This is not a bug rather problem, you can fix it. You are almost there.
>> Please understand the setup and fix it, else you cannot troubleshoot it as
>> needed. i am sure there is problem with the counter which perform check
>> item test. or there is no gigaword check-item defined. today i am in full
>> day meeting cannot help further. list down the steps you feel you need to
>> check and see.
>>
>>
>> Have you done this ?
>>
>>
>> 4.) Adding Max-All-MB in dictionary file
>> “/usr/share/freeradius/dictionary.chilli” --> nano
>> /usr/share/freeradius/dictionary.chilli
>> A TTRIBUTE Max-All-MB 3080 integer
>>
>> 5.) Specify Check Attributes (check-itmes) Max-All-MB := 6144
>>
>> Thanks
>>
>>
>>
>> On Wed, Oct 15, 2014 at 6:58 PM, Abdullah <b.hawks123 at gmail.com> wrote:
>>
>>> ok the counter works great and user gets disconnected with the value set
>>> but when the user logins next time, he is able to login again and use
>>> the same amount of data again
>>> the count_in_mb counter gets the value 4080 instead of 6144
>>> anything wrong with the query?
>>>
>>> On Wed, Oct 15, 2014 at 9:35 PM, Russell Mike <radius.sir at gmail.com>
>>> wrote:
>>>
>>>> no v2.2 but would not be difference. setup your 2GB limits working
>>>> before jumping to above 4GB.
>>>>
>>>> On Wed, Oct 15, 2014 at 2:40 PM, Abdullah <b.hawks123 at gmail.com> wrote:
>>>>
>>>>> yes i have setup mysql
>>>>> apparently custom counters dont work. are you using fr3 for providing
>>>>> the download limits?
>>>>>
>>>>> On Wed, Oct 15, 2014 at 7:36 PM, Russell Mike <radius.sir at gmail.com>
>>>>> wrote:
>>>>>
>>>>>> Abdullah,
>>>>>>
>>>>>> Did you say your counter does not work ? Of course you need
>>>>>> rlm_counter. Have you already done mysql setup ? Counter would not even
>>>>>> help if you have not setup proper accounting MySQL etc...
>>>>>>
>>>>>> Well, here is the counter i use. it is little way different your own,
>>>>>> i use Max-All-MB CoovaChilli attributes to scale more than terabyte. if you
>>>>>> need to follow step by step how to setup MAX-All-MB. follow my blog. i am
>>>>>> already providing up to 100GB.
>>>>>>
>>>>>>
>>>>>> http://prabhpal.wordpress.com/2013/11/05/settings-data-limits-traffic-quota-volume-quota-download-limits-more-than-higher-than-4gb-for-users-using-freeradius-coovachilli/
>>>>>>
>>>>>>
>>>>>>
>>>>>> sqlcounter chillispot_max_all_mb {
>>>>>>
>>>>>> counter-name = "Download-Limit-MB"
>>>>>> check-name = "Max-All-MB"
>>>>>> reply-name = "Session-Timeout"
>>>>>> reply-message = "You have reached your bandwidth limit"
>>>>>> sqlmod-inst = "sql"
>>>>>> key = "User-Name"
>>>>>> reset = "never"
>>>>>> cache-size = 5000
>>>>>> query = "SELECT SUM(AcctInputOctets) / (1024*1024) +
>>>>>> SUM(AcctOutputOctets) / (1024*1024) FROM radacct WHERE UserName='%{%k}'"
>>>>>> }
>>>>>>
>>>>>>
>>>>>> Thanks / RM--
>>>>>>
>>>>>> On Wed, Oct 15, 2014 at 2:14 PM, Abdullah <b.hawks123 at gmail.com>
>>>>>> wrote:
>>>>>>
>>>>>>> i am usig coova chilli
>>>>>>> so lets say i want to set 10GB
>>>>>>> i set ChilliSpot-Max-Total-Octets=2147483648
>>>>>>> and Gigawords = 2
>>>>>>> but how will the user get disconnected at 10gb? do i need a counter
>>>>>>> or will it be done automaticallly?
>>>>>>>
>>>>>>> On Wed, Oct 15, 2014 at 6:57 PM, Russell Mike <radius.sir at gmail.com>
>>>>>>> wrote:
>>>>>>>
>>>>>>>> Hi
>>>>>>>>
>>>>>>>> Which NAS are you using ? Use "gigaword" attribute to define the
>>>>>>>> limits more than 4GB. it is easy, for example, if you want 10 Gb limit.
>>>>>>>>
>>>>>>>> *The Value Of 10GB In Bytes If Following*
>>>>>>>> 10737418240
>>>>>>>>
>>>>>>>>
>>>>>>>> *The Value of Octets_Attribute For Check Item*
>>>>>>>> 2147483648
>>>>>>>>
>>>>>>>> *The Value of Gigawords_Attribute For Check Item*
>>>>>>>> 2
>>>>>>>>
>>>>>>>> Use the following python script to calculate the values when ever
>>>>>>>> you need. Change the value in VARIABLE "*GB_Value*" to the number
>>>>>>>> you want.
>>>>>>>>
>>>>>>>> #!/usr/bin/python
>>>>>>>> GB_Value = 10
>>>>>>>>
>>>>>>>> Total_Bytes = GB_Value*(1024**3)
>>>>>>>> print 'The Value Of Given Number In Bytes If Following', '\n',
>>>>>>>> Total_Bytes
>>>>>>>>
>>>>>>>> Octets_Attribute = GB_Value*(1024**3) & ((2**32)-1);
>>>>>>>> Gigawords_Attribute = GB_Value*(1024**3) >> 32;
>>>>>>>>
>>>>>>>> print '\n'
>>>>>>>> print 'The Value of Octets_Attribute is' '\n', Octets_Attribute
>>>>>>>> print 'The Value of Gigawords_Attribute is' '\n',
>>>>>>>> Gigawords_Attribute
>>>>>>>>
>>>>>>>> print '\n' 'Confirming Calculations & Giving Results:'
>>>>>>>>
>>>>>>>> i = (Gigawords_Attribute<<32) + Octets_Attribute;
>>>>>>>> #i = (1<<32) + Octets_Attribute;
>>>>>>>> print 'This Number Must Equel To Bytes Of Given Number. Please
>>>>>>>> Verify', i
>>>>>>>>
>>>>>>>> j = GB_Value*(1024**3);
>>>>>>>> print 'Using Second Methos To Verify Output Number. Is This Orignal
>>>>>>>> Number in Bytes ', j,'?'
>>>>>>>> print '\n'
>>>>>>>>
>>>>>>>>
>>>>>>>> I trust this helps.
>>>>>>>> Thanks / RM--
>>>>>>>>
>>>>>>>>
>>>>>>>>
>>>>>>>>
>>>>>>>> On Wed, Oct 15, 2014 at 1:34 PM, johan firdianto <
>>>>>>>> johanfirdi at gmail.com> wrote:
>>>>>>>>
>>>>>>>>> you should define integer64 for volume attribute in fr dictionary.
>>>>>>>>> On Oct 15, 2014 8:25 PM, "Abdullah" <b.hawks123 at gmail.com> wrote:
>>>>>>>>>
>>>>>>>>>> Hello
>>>>>>>>>> Fr disconects the user auto at 2gb, when i increase the
>>>>>>>>>> ChilliSpot-Max-Total-Octets to anything more than 3.9GB, it never
>>>>>>>>>> disconnects the user whereas any value under 3.9GB works fine and user gets
>>>>>>>>>> disconnected when the limit is reached.
>>>>>>>>>>
>>>>>>>>>> I need some help as to how volume greater than 4GB can be
>>>>>>>>>> implemented. I have tried some older methods involving setting up counters
>>>>>>>>>> but either they dont get called/executed from the same config files as in
>>>>>>>>>> 2.x branch
>>>>>>>>>>
>>>>>>>>>> So please guide me as to how can it be achieved
>>>>>>>>>>
>>>>>>>>>> Regards,
>>>>>>>>>>
>>>>>>>>>> -
>>>>>>>>>> List info/subscribe/unsubscribe? See
>>>>>>>>>> http://www.freeradius.org/list/users.html
>>>>>>>>>>
>>>>>>>>>
>>>>>>>>> -
>>>>>>>>> List info/subscribe/unsubscribe? See
>>>>>>>>> http://www.freeradius.org/list/users.html
>>>>>>>>>
>>>>>>>>
>>>>>>>>
>>>>>>>> -
>>>>>>>> List info/subscribe/unsubscribe? See
>>>>>>>> http://www.freeradius.org/list/users.html
>>>>>>>>
>>>>>>>
>>>>>>>
>>>>>>> -
>>>>>>> List info/subscribe/unsubscribe? See
>>>>>>> http://www.freeradius.org/list/users.html
>>>>>>>
>>>>>>
>>>>>>
>>>>>> -
>>>>>> List info/subscribe/unsubscribe? See
>>>>>> http://www.freeradius.org/list/users.html
>>>>>>
>>>>>
>>>>>
>>>>> -
>>>>> List info/subscribe/unsubscribe? See
>>>>> http://www.freeradius.org/list/users.html
>>>>>
>>>>
>>>>
>>>> -
>>>> List info/subscribe/unsubscribe? See
>>>> http://www.freeradius.org/list/users.html
>>>>
>>>
>>>
>>> -
>>> List info/subscribe/unsubscribe? See
>>> http://www.freeradius.org/list/users.html
>>>
>>
>>
>> -
>> List info/subscribe/unsubscribe? See
>> http://www.freeradius.org/list/users.html
>>
>
>
> -
> List info/subscribe/unsubscribe? See
> http://www.freeradius.org/list/users.html
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.freeradius.org/pipermail/freeradius-users/attachments/20141016/22c51cab/attachment-0001.html>
More information about the Freeradius-Users
mailing list