Hello Alan,

AD> Alexander Lunyov <[EMAIL PROTECTED]> wrote:
>>    I'm running FreeRadius 0.9.3 on FreeBSD 4.8R-p13, and now i'm
>>    planning to start using radius for authenticating and accounting my
>>    Ethernet users via PPPoE. Can you tell me, where to read about 'how
>>    to setup traffic limits with freeradius'?
AD>   You can't, really.  You can enforce traffic limits after a user has
AD> exceeded quota, for the next time a user logs in.  But you can't tell
AD> the NAS to kick a user off once they've reached their quota.

    Well, i'm using exppp (http://shs.sumy.ua/, but it's in russian) on
    FreeBSD box, and exppp understands his own attributes
    (Exppp-Traffic-Limit and such), and i think it can kick user when
    traffic exceeds. How can freeradius tell exppp, how much octets
    user have for session? I mean, if all accounting information is in
    mysql base, radius have to do simple SELECT to sql with sum()'s,
    then substract this value (it will be number of octets) from some
    fixed value of limit and give the result to exppp as
    Exppp-Traffic-Limit. Well, or something like that. Can it be done
    in FreeRadius? I mean, all those sql queries, substraction and all
    of that?

>> Because it seems to be that
>>    attributes such as Monthly-Octets-Limit and Daily-Octets-Limit can
>>    be used only with IC-Radius, and i didn't found anything about
>>    freeradius.
AD>   See rlm_counter.  It counts and enforces limitations.  The example
AD> configuration enforces time limits, but you can easily re-configure it
AD> to enforce bandwidth limits.

    Oh, it's interesting! I think something like this will help
    (rlm_sqlcounter):

sqlcounter monthlytraffic {
                counter-name = Monthly-Traffic
                check-name = Max-Monthly-Traffic
                sqlmod-inst = sql
                key = User-Name
                reset = monthly

                query = "SELECT (sum(AcctInputOctets)+sum(AcctOutputOctets))
                FROM radacct WHERE UserName='%{%k}' AND
                Month(AcctStopTime) =(Month(NOW())-1) AND
                Year(AcctStopTime) = Year(NOW())"
    }

    But, if i've understanded it right, this module reflects only on
    logon process, i mean, it won't pass no attributes to NAS, it just
    reject user if user's traffic is over, am i right? Still, radius
    have to return traffic limit value to NAS (exppp), how can it (or i) do this?

-- 
Best regards,
 Alexander                            mailto:[EMAIL PROTECTED]


- 
List info/subscribe/unsubscribe? See http://www.freeradius.org/list/users.html

Reply via email to