sqlcounters for traffic

Alexandre Chapellon alexandre.chapellon at mana.pf
Sat Sep 6 02:54:10 CEST 2008



tnt at kalik.net a écrit :
>> My first problem is that the Session-Traffic-Limit (from the redback
>> dictionnary) is not returned. I can't see it neither in the output of
>> radtest nor with radsniff.
>> Yet, looking at the output of radiusd -X i can see it's correctly
>> understood by freeradius:
>>
>> rlm_sqlcounter: Check item is greater than query result
>> rlm_sqlcounter: Authorized user scott, check_item=12000, counter=10891
>> rlm_sqlcounter: Sent Reply-Item for user scott,
>> Type=Session-Traffic-Limit, value=12792
>> ++[bytesQuota] returns ok
>>
>>     
> It looks like it made it to the reply list.
>   
Yep, but when sniffing network, it appears it's not.
>   
>> Does anyone has a clue?
>>
>>     
>
> Not without the rest of the debug.
>   
Here is the full debug  outputed during the auth query/reply

rad_recv: Access-Request packet from host 127.0.0.1 port 37792, id=201,
length=57
    User-Name = "scott"
    User-Password = "tiger"
    NAS-IP-Address = 192.168.20.145
    NAS-Port = 451
+- entering group authorize
++[preprocess] returns ok
++[chap] returns noop
++[mschap] returns noop
    rlm_realm: No '@' in User-Name = "scott", looking up realm NULL
    rlm_realm: No such realm "NULL"
++[suffix] returns noop
  rlm_eap: No EAP-Message, not doing EAP
++[eap] returns noop
++[unix] returns notfound
    users: Matched entry scott at line 205
++[files] returns ok
++[expiration] returns noop
++[logintime] returns noop
++[pap] returns updated
rlm_sqlcounter: Entering module authorize code
sqlcounter_expand:  'SELECT SUM(acctinputoctets + acctoutputoctets) FROM
radacct WHERE UserName='%{User-Name}''
    expand: SELECT SUM(acctinputoctets + acctoutputoctets) FROM radacct
WHERE UserName='%{User-Name}' -> SELECT SUM(acctinputoctets +
acctoutputoctets) FROM radacct WHERE UserName='scott'
sqlcounter_expand:  '%{mysqldb:SELECT SUM(acctinputoctets +
acctoutputoctets) FROM radacct WHERE UserName='scott'}'
rlm_sql (mysqldb): - sql_xlat
    expand: %{User-Name} -> scott
rlm_sql (mysqldb): sql_set_user escaped user --> 'scott'
    expand: SELECT SUM(acctinputoctets + acctoutputoctets) FROM radacct
WHERE UserName='scott' -> SELECT SUM(acctinputoctets + acctoutputoctets)
FROM radacct WHERE UserName='scott'
    expand: /var/log/freeradius/sqltrace.sql ->
/var/log/freeradius/sqltrace.sql
rlm_sql (mysqldb): Reserving sql socket id: 4
rlm_sql_mysql: query:  SELECT SUM(acctinputoctets + acctoutputoctets)
FROM radacct WHERE UserName='scott'
rlm_sql (mysqldb): - sql_xlat finished
rlm_sql (mysqldb): Released sql socket id: 4
    expand: %{mysqldb:SELECT SUM(acctinputoctets + acctoutputoctets)
FROM radacct WHERE UserName='scott'} -> 10891
rlm_sqlcounter: Check item is greater than query result
rlm_sqlcounter: Authorized user scott, check_item=12000, counter=10891
rlm_sqlcounter: Sent Reply-Item for user scott,
Type=Session-Traffic-Limit, value=12694
++[bytesQuota] returns ok
  rad_check_password:  Found Auth-Type
auth: type "PAP"
+- entering group PAP
rlm_pap: login attempt with password "tiger"
rlm_pap: Using clear text password "tiger"
rlm_pap: User authenticated successfully
++[pap] returns ok
+- entering group session
    expand: %{User-Name} -> scott
rlm_sql (mysqldb): sql_set_user escaped user --> 'scott'
    expand: SELECT COUNT(*)                              FROM
radacct                              WHERE username =
'%{SQL-User-Name}'                              AND acctstoptime IS NULL
-> SELECT COUNT(*)                              FROM
radacct                              WHERE username =
'scott'                              AND acctstoptime IS NULL
rlm_sql (mysqldb): Reserving sql socket id: 3
rlm_sql_mysql: query:  SELECT COUNT(*)                              FROM
radacct                              WHERE username =
'scott'                              AND acctstoptime IS NULL
rlm_sql (mysqldb): Released sql socket id: 3
++[mysqldb] returns ok
+- entering group post-auth
    expand: %{NAS-IP-Address} %{NAS-Port} -> 192.168.20.145 451
rlm_ippool: MD5 on 'key' directive maps to: 20879599c5e6463384e80698249eaa87
rlm_ippool: Searching for an entry for key:
'20879599c5e6463384e80698249eaa87'
rlm_ippool: Found a stale entry for ip: 10.0.116.61
rlm_ippool: num: 0
rlm_ippool: Allocating ip to key: '20879599c5e6463384e80698249eaa87'
rlm_ippool: num: 1
rlm_ippool: Allocated ip 10.0.129.45 to client key:
20879599c5e6463384e80698249eaa87
++[test_pool] returns ok
rlm_sql (mysqldb): Processing sql_postauth
    expand: %{User-Name} -> scott
rlm_sql (mysqldb): sql_set_user escaped user --> 'scott'
    expand: %{User-Password} -> tiger
    expand: INSERT INTO radpostauth                           (username,
pass, reply, authdate)                           VALUES
(                           '%{User-Name}',                          
'%{%{User-Password}:-%{Chap-Password}}',                          
'%{reply:Packet-Type}', '%S') -> INSERT INTO
radpostauth                           (username, pass, reply,
authdate)                           VALUES (                          
'scott',                           'tiger',                          
'Access-Accept', '2008-09-05 14:48:26')
    expand: /var/log/freeradius/sqltrace.sql ->
/var/log/freeradius/sqltrace.sql
rlm_sql (mysqldb) in sql_postauth: query is INSERT INTO
radpostauth                           (username, pass, reply,
authdate)                           VALUES (                          
'scott',                           'tiger',                          
'Access-Accept', '2008-09-05 14:48:26')
rlm_sql (mysqldb): Reserving sql socket id: 2
rlm_sql_mysql: query:  INSERT INTO radpostauth                          
(username, pass, reply, authdate)                           VALUES
(                           'scott',                          
'tiger',                           'Access-Accept', '2008-09-05 14:48:26')
rlm_sql (mysqldb): Released sql socket id: 2
++[mysqldb] returns ok
++[exec] returns noop
Sending Access-Accept of id 201 to 127.0.0.1 port 37792
    Session-Traffic-Limit = ""
    Framed-IP-Address = 10.0.129.45
    Framed-IP-Netmask = 255.255.255.255
Finished request 0.


> Ivan Kalik
> Kalik Informatika ISP
>
> -
> 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/20080905/75d780e2/attachment.html>


More information about the Freeradius-Users mailing list