(RADIATOR) alive timestamp updates SessionDatabase

Hugh Irvine hugh at open.com.au
Tue Apr 15 03:11:54 CDT 2003


Hello David -

Try something like this:

Foreground
LogStdout

LogDir /var/log/radius
DbDir .

Trace 0
LogFile /var/log/radius/logfile
BindAddress xxx.xxx.xxx.xxx

<Client DEFAULT>
     Secret xxxx
     DupInterval 2
</Client>

<SessionDatabase NULL>
     Identifier NULLSDB
</SessionDatabase>

<Handler Acct-Status-Type = Alive>
	SessionDatabase NULLSDB
	<AuthBy INTERNAL>
		AcctResult ACCEPT
	</AuthBy>
</Handler>

<Handler>
     AcctLogFileName /var/log/radius/detail
     PasswordLogFileName /var/log/radius/passwords
     AuthByPolicy ContinueWhileAccept
     <AuthBy FILE>
         Filename /var/log/radius/users
     </AuthBy>
     <AuthBy SQL>
         DBSource dbi:mysql:host=xxxx;database=xxxx
         DBUsername xxxx
         DBAuth xxxx
         AuthSelect SELECT password FROM RealNames WHERE username = '%n'
         EncryptedPassword
         DefaultSimultaneousUse 1
         AccountingTable %V%Y
         AccountingStopsOnly
         AcctColumnDef annex,NAS-IP-Address
         AcctColumnDef username,User-Name
         AcctColumnDef bytesin,Acct-Input-Octets,integer
         AcctColumnDef bytesout,Acct-Output-Octets,integer
         AcctColumnDef sessionlength,Acct-Session-Time,integer
         AcctColumnDef ipaddress,Framed-IP-Address
     </AuthBy>
</Handler>

<SessionDatabase SQL>
     DBSource dbi:mysql:host=xxxx;database=xxxx
     DBUsername xxxx
     DBAuth xxxx
     AddQuery insert into
RADONLINE(USERNAME,NASIDENTIFIER,ACCTSESSIONID,TIME_STAMP,FRAMEDIPADDRES 
S,SV
R_KEY,CALLING_STATION) values
('%u','%1',%3,%{Timestamp},'%{Framed-IP-Address}','%{Ascend-Session- 
Svr-Key}
','%{Calling-Station-Id}')
     DeleteQuery delete from RADONLINE where USERNAME='%0'
</SessionDatabase SQL>


There are also more complicated variations possible.

regards

Hugh


On Tuesday, Apr 15, 2003, at 12:31 Australia/Melbourne, David Booth  
wrote:

> Hi radiator,
>
> I have a fixed number of ports. I am using a perl script to count  
> RADONLINE
> every minute.
> If count >= number of ports I want to kick the longest session  
> identified by
> smallest TIMESTAMP
> I have to do this by submitting to a remote script (not my NAS).
>
> Its all working well but it looks to me as though 'alive' packets are
> updating TIMESTAMP so I'm not booting the *longest* session.
>
> I don't really need the alive records at all except to repopulate  
> RADONLINE
> if I clear it for some reason.
> Perhaps I should drop 'alive's as in
> http://www.open.com.au/archives/radiator/2000-09/msg00123.html
>
> Or is there something preferable?
>
> David Booth
> Goulburn Internet
> http://www.goulburn.net.au
> 0500522400
>
> Foreground
> LogStdout
> LogDir /var/log/radius
> DbDir .
> Trace 0
> LogFile /var/log/radius/logfile
> BindAddress xxx.xxx.xxx.xxx
> <Client DEFAULT>
>     Secret xxxx
>     DupInterval 2
> </Client>
> <Realm DEFAULT>
>     AcctLogFileName /var/log/radius/detail
>     PasswordLogFileName /var/log/radius/passwords
>     AuthByPolicy ContinueWhileAccept
>     <AuthBy FILE>
>         Filename /var/log/radius/users
>     </AuthBy>
>     <AuthBy SQL>
>         DBSource dbi:mysql:host=xxxx;database=xxxx
>         DBUsername xxxx
>         DBAuth xxxx
>         AuthSelect SELECT password FROM RealNames WHERE username = '%n'
>         EncryptedPassword
>         DefaultSimultaneousUse 1
>         AccountingTable %V%Y
>         AccountingStopsOnly
>         AcctColumnDef annex,NAS-IP-Address
>         AcctColumnDef username,User-Name
>         AcctColumnDef bytesin,Acct-Input-Octets,integer
>         AcctColumnDef bytesout,Acct-Output-Octets,integer
>         AcctColumnDef sessionlength,Acct-Session-Time,integer
>         AcctColumnDef ipaddress,Framed-IP-Address
>     </AuthBy>
> </Realm>
> <SessionDatabase SQL>
>     DBSource dbi:mysql:host=xxxx;database=xxxx
>     DBUsername xxxx
>     DBAuth xxxx
>     AddQuery insert into
> RADONLINE(USERNAME,NASIDENTIFIER,ACCTSESSIONID,TIME_STAMP,FRAMEDIPADDRE 
> SS,SV
> R_KEY,CALLING_STATION) values
> ('%u','%1',%3,%{Timestamp},'%{Framed-IP-Address}','%{Ascend-Session- 
> Svr-Key}
> ','%{Calling-Station-Id}')
>     DeleteQuery delete from RADONLINE where USERNAME='%0'
> </SessionDatabase SQL>
>
>
> ===
> Archive at http://www.open.com.au/archives/radiator/
> Announcements on radiator-announce at open.com.au
> To unsubscribe, email 'majordomo at open.com.au' with
> 'unsubscribe radiator' in the body of the message.
>
>

NB: have you included a copy of your configuration file (no secrets),
together with a trace 4 debug showing what is happening?

-- 
Radiator: the most portable, flexible and configurable RADIUS server
anywhere. Available on *NIX, *BSD, Windows 95/98/2000, NT, MacOS X.
-
Nets: internetwork inventory and management - graphical, extensible,
flexible with hardware, software, platform and database independence.

===
Archive at http://www.open.com.au/archives/radiator/
Announcements on radiator-announce at open.com.au
To unsubscribe, email 'majordomo at open.com.au' with
'unsubscribe radiator' in the body of the message.


More information about the radiator mailing list