From: Andrés de Barros <[EMAIL PROTECTED]>
Reply-To: [EMAIL PROTECTED]
To: <[EMAIL PROTECTED]>
Subject: rlm_sqlcounter Max-Daily-Session
Date: Tue, 17 Feb 2004 17:09:48 -0300

Problems with rlm_sqlcounter, Max-Daily-Session
It is connected during 30s and one becomes disconnected.
The problem is that I do not have stop in the connection.

Not clear on the question but you have set up the counter to tell the NAS to disconnect the user after 30s. i.e. the Session-Timeout RADIUS attribute is sent back to NAS with 30 secs. as usage time. The NAS then should disconnect you after 30 secs. if your connection is still active then its down to the NAS and not freeradius i.e. the NAS sent back a stop accounting packet so it should have terminated the connection.


What behaviour do you want / expect ?


As I solve east problem


sqlcounter.conf:

sqlcounter dailycounter {
                driver = "rlm_sqlcounter"
                counter-name = Daily-Session-Time
                check-name = Max-Daily-Session
                sqlmod-inst = sqlcca3
                key = User-Name
                reset = daily

                query = "SELECT SUM(AcctSessionTime - GREATEST((%b -
UNIX_TIMESTAMP(AcctStartTime)), 0)) \
                FROM radacct WHERE UserName='%{%k}' AND
UNIX_TIMESTAMP(AcctStartTime) + AcctSessionTime > 'b' "


select * from radcheck where username = '[EMAIL PROTECTED]'; +----+-------------+-----------------+----+-------+ | id | UserName | Attribute | op | Value | +----+-------------+-----------------+----+-------+ | 6 | [EMAIL PROTECTED] | User-Password | := | leo | | 15 | [EMAIL PROTECTED] | Max-daily-Session | := | 30 | +----+-------------+-----------------+----+-------+ 2 rows in set (0.00 sec)

 select * from radgroupcheck where groupname = 'static_64k';
+----+------------+-----------+----+-------+
| id | GroupName  | Attribute | op | Value |
+----+------------+-----------+----+-------+
| 17 | static_64k | Auth-Type | := | Local |
+----+------------+-----------+----+-------+
1 row in set (0.00 sec)

select * from radgroupreply where groupname = 'static_64k';
+----+------------+---------------------------+----+---------------------+--
----+
| id | GroupName  | Attribute                 | op | Value               |
prio |
+----+------------+---------------------------+----+---------------------+--
----+
| 24 | static_64k | Framed-Protocol           | =  | PPP                 |
0 |
| 49 | static_64k | Framed-Routing            | =  | Broadcast-Listen    |
0 |
| 25 | static_64k | Framed-Compression        | =  | Van-Jacobson-TCP-IP |
0 |
| 26 | static_64k | RP-Upstream-Speed-Limit   | =  | 64                  |
0 |
| 27 | static_64k | RP-Downstream-Speed-Limit | =  | 64                  |
0 |
| 46 | static_64k | Service-Type              | =  | Framed-User         |
0 |
| 50 | static_64k | Framed-MTU                | =  | 1500                |
0 |
+----+------------+---------------------------+----+---------------------+--
----+
7 rows in set (0.00 sec)

select * from radreply where username = '[EMAIL PROTECTED]';
+----+-------------+-------------------+----+---------------+
| id | UserName    | Attribute         | op | Value         |
+----+-------------+-------------------+----+---------------+
|  5 | [EMAIL PROTECTED] | Framed-IP-Address | =  | 192.168.2.103 |
+----+-------------+-------------------+----+---------------+
1 row in set (0.01 sec)

select * from usergroup where username = '[EMAIL PROTECTED]';
+----+-------------+------------+
| id | UserName    | GroupName  |
+----+-------------+------------+
|  6 | [EMAIL PROTECTED] | static_64k |
+----+-------------+------------+
1 row in set (0.00 sec)



radiusd -x
Starting - reading configuration files ...
Using deprecated naslist file. Support for this will go away soon.
Using deprecated clients file. Support for this will go away soon.
Using deprecated realms file. Support for this will go away soon.
Module: Loaded expr
Module: Instantiated expr (expr)
Module: Loaded PAP
Module: Instantiated pap (pap)
Module: Loaded CHAP
Module: Instantiated chap (chap)
Module: Loaded MS-CHAP
Module: Instantiated mschap (mschap)
Module: Loaded preprocess
Module: Instantiated preprocess (preprocess)
Module: Loaded realm
Module: Instantiated realm (suffix)
Module: Loaded SQL
rlm_sql (sql): Driver rlm_sql_mysql (module rlm_sql_mysql) loaded and linked
rlm_sql (sql): Attempting to connect to [EMAIL PROTECTED]:/radius
rlm_sql (sql): starting 0
rlm_sql (sql): Attempting to connect rlm_sql_mysql #0
rlm_sql_mysql: Starting connect to MySQL server for #0
rlm_sql (sql): Connected new DB handle, #0
rlm_sql (sql): starting 1
rlm_sql (sql): Attempting to connect rlm_sql_mysql #1
rlm_sql_mysql: Starting connect to MySQL server for #1
rlm_sql (sql): Connected new DB handle, #1
rlm_sql (sql): starting 2
rlm_sql (sql): Attempting to connect rlm_sql_mysql #2
rlm_sql_mysql: Starting connect to MySQL server for #2
rlm_sql (sql): Connected new DB handle, #2
rlm_sql (sql): starting 3
rlm_sql (sql): Attempting to connect rlm_sql_mysql #3
rlm_sql_mysql: Starting connect to MySQL server for #3
rlm_sql (sql): Connected new DB handle, #3
rlm_sql (sql): starting 4
rlm_sql (sql): Attempting to connect rlm_sql_mysql #4
rlm_sql_mysql: Starting connect to MySQL server for #4
rlm_sql (sql): Connected new DB handle, #4
Module: Instantiated sql (sql)
Module: Loaded files
Module: Instantiated files (files)
Module: Loaded SQL Counter
Module: Instantiated sqlcounter (noresetcounter)
Module: Instantiated sqlcounter (dailycounter)
Module: Instantiated sqlcounter (monthlycounter)
Module: Loaded Acct-Unique-Session-Id
Module: Instantiated acct_unique (acct_unique)
Module: Loaded detail
Module: Instantiated detail (detail)
Module: Loaded System
Module: Instantiated unix (unix)
Module: Loaded radutmp
Module: Instantiated radutmp (radutmp)
Module: Loaded IPPOOL
Module: Instantiated ippool (prueba_pool)
Initializing the thread pool...
Listening on IP address *, ports 1812/udp and 1813/udp, with proxy on
1814/udp.
Ready to process requests.
rad_recv: Access-Request packet from host 192.168.1.2:32768, id=26,
length=116
Service-Type = Framed-User
Framed-Protocol = PPP
User-Name = "[EMAIL PROTECTED]"
CHAP-Challenge = 0xae2f5a00cb79943875d8495205a46b1c9d360d
CHAP-Password = 0x0155f05f263961f53a8db2b62c8d26c17a
Calling-Station-Id = "00:10:A4:8A:8E:1A"
NAS-IP-Address = 192.168.1.2
NAS-Port = 443
rlm_chap: Setting 'Auth-Type := CHAP'
rlm_sql (sql): Reserving sql socket id: 4
rlm_sql (sql): Released sql socket id: 4
rlm_ippool: Could not find Pool-Name attribute.
Sending Access-Accept of id 26 to 192.168.1.2:32768
Framed-IP-Address = 192.168.2.103
Framed-Protocol = PPP
Framed-Compression = Van-Jacobson-TCP-IP
RP-Upstream-Speed-Limit = 64
RP-Downstream-Speed-Limit = 64
Service-Type = Framed-User
Framed-Routing = Broadcast-Listen
Framed-MTU = 1500
Session-Timeout = 30
rad_recv: Accounting-Request packet from host 192.168.1.2:32768, id=27,
length=126
Acct-Session-Id = "40327469764B"
User-Name = "[EMAIL PROTECTED]"
Acct-Status-Type = Start
Service-Type = Framed-User
Framed-Protocol = PPP
Calling-Station-Id = "00:10:A4:8A:8E:1A"
Acct-Authentic = RADIUS
NAS-Port-Type = Async
Framed-IP-Address = 192.168.2.103
Framed-IP-Netmask = 0.0.0.0
NAS-IP-Address = 192.168.1.2
NAS-Port = 443
Acct-Delay-Time = 0
rlm_sql (sql): Reserving sql socket id: 3
rlm_sql (sql): Released sql socket id: 3
rlm_ippool: This is not an Accounting-Stop. Return NOOP.
Sending Accounting-Response of id 27 to 192.168.1.2:32768
rad_recv: Accounting-Request packet from host 192.168.1.2:32768, id=28,
length=144
Acct-Session-Id = "40327469764B"
User-Name = "[EMAIL PROTECTED]"
Acct-Status-Type = Stop
Service-Type = Framed-User
Framed-Protocol = PPP
Acct-Authentic = RADIUS
Acct-Session-Time = 32
Acct-Output-Octets = 1196
Acct-Input-Octets = 2302
Calling-Station-Id = "00:10:A4:8A:8E:1A"
NAS-Port-Type = Async
Framed-IP-Address = 192.168.2.103
Framed-IP-Netmask = 0.0.0.0
NAS-IP-Address = 192.168.1.2
NAS-Port = 443
Acct-Delay-Time = 0
rlm_sql (sql): Reserving sql socket id: 2
rlm_sql (sql): Released sql socket id: 2
rlm_ippool: Searching for an entry for nas/port: 192.168.1.2/443
rlm_ippool: Entry not found
Sending Accounting-Response of id 28 to 192.168.1.2:32768



Andrés de Barros Ingeniería en Data Canelones 2271 11200 Montevideo - Uruguay Tel: (598 2) 408 3506* http://www.itprola.com [EMAIL PROTECTED]


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

_________________________________________________________________
Express yourself with cool emoticons - download MSN Messenger today! http://www.msn.co.uk/messenger



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

Reply via email to