> -----Original Message-----
> From: [EMAIL PROTECTED]
> [mailto:[EMAIL PROTECTED] Behalf Of
> Alan DeKok
> Sent: Thursday, July 24, 2003 6:50 AM
> To: [EMAIL PROTECTED]
> Subject: Re: Session Timeout
>
>
> "Alex Chen" <[EMAIL PROTECTED]> wrote:
> > > rlm_counter?
> >
> > How is it used? Where can I find a document about this?
>
> Have you tried reading the configuration files?
>
Using the daily counter in radiusd.conf as an example, here is my
understanding
correct me if I am wrong.
1. The counter module keeps its own DB, i.e. db.daily.
2. Counter uses 'User-Name' as the key and creates a counter for it.
It looks for a counter attribute, 'Acct-Session-Time', in the accounting
packets and increments the value of this attribute in its DB by the
amount specified in the request.
3, When the 'Acct-Session-Time' value reaches the limit specified by
'check-name',
'Max-Daily-Session' in the example, the request will be rejected.
Otherwise, on the user's next login, a 'Session-Timeout' attribute will
contain the remaining value of the 'check-name' attribute, i.e.
'Max-Daily-Session'.
For testing purpose, I want to limit the total session to 20 seconds.
The example uses Max-Daily-Session, but these is no such attribute name and
radiusd
fails to start if I set it, so I used 'Session-Timeout'.
Instead of setting this in 'users' files, I set it in MySQL radcheck table:
mysql> select * from radcheck;
+----+----------+-----------------+----+------------------------------------
+
| id | UserName | Attribute | op | Value
|
+----+----------+-----------------+----+------------------------------------
+
| 1 | Alex | Crypt-Password | == | $1$I9cEHQWQ$s1nzERngXkHeG7f.Koj2c.
|
| 2 | Alex | Session-Timeout | := | 20
|
+----+----------+-----------------+----+------------------------------------
+
2 rows in set (0.00 sec)
mysql>
The setting in radiusd.conf
module {
...
counter daily {
filename = ${raddbdir}/db.daily
key = User-Name
count-attribute = Acct-Session-Time
reset = daily
counter-name = Daily-Session-Time
check-name = Session-Timeout
allowed-servicetype = Outbound-User
cache-size = 5000
}
}
But then I always get 'Session-Timeout = 20' in the reply for the
same user, regardless of how much time is set in 'Acct-Session-Time' when
I sent when stopping the accounting.
The same result happens even if I set it in 'users'.
What am I missing here? Any help is appreciated.
-
List info/subscribe/unsubscribe? See http://www.freeradius.org/list/users.html