(RADIATOR) TimeBanking
Ronan Eckelberry
radiator at gowebco.com
Fri Jun 7 16:08:49 CDT 2002
Jack,
Below you will find my config (no IP or secrets). It should be of
some help to you. I hope you can modify it to your needs. :)
-Ronan
##Globabl Config Options###
DbDir /usr/local/Radiator
DictionaryFile %D/dictionary
#FingerProg /usr/bin/finger
LivingstonHole 1
LivingstonOffs 22
LogDir /usr/log/radius
LogFile %L/radius.log
#PmwhoProg /usr/local/sbin/pmwho
SnmpgetProg /usr/local/bin/snmpget
Trace 4
#AuthPort 1812
#AcctPort 1813
<Client localhost>
Description Local Test
DupInterval 0
Secret xxxxxxxxx
</Client>
<Client xxx.xxx.xxx>
Description Check Customer Time
DupInterval 0
Secret xxxxxxxxx
DefaultRealm checktime
</Client>
<Client xxx.xxx.xxx>
Description Lucent PM3
DupInterval 2
NasType Livingston
Secret xxxxxxxxx
</Client>
<Client xxx.xxx.xxx>
Description Lucent PM3
DupInterval 2
NasType Livingston
Secret xxxxxxxxx
</Client>
<Client xxx.xxx.xxx>
Description Lucent PM3
DupInterval 2
NasType Livingston
Secret xxxxxxxxx
</Client>
<Client xxx.xxx.xxx>
Description Lucent PM3
DupInterval 2
Secret xxxxxxxxx
</Client>
<Client xxx.xxx.xxx>
Description Cisco AS5300 Access Server
DupInterval 2
NasType Cisco
Secret xxxxxxxxx
</Client>
##AuthBy Clauses##
<AuthBy SQL>
Identifier SUBSCRIBERS
DBSource dbi:mysql:radius:xxx.xxx.xxx
DBUsername xxxxxxxxx
DBAuth xxxxxxxxx
DefaultSimultaneousUse 1
Description Database to use to authenticate users
FailureBackoffTime 5
Timeout 20
AuthSelect select PASSWORD,PORTLIMIT,STATICIP,SIMLOGIN from
SUBSCRIBERS where USERNAME='%n' AND ACTIVE='Y'
# AuthSelect select PASSWORD from SUBSCRIBERS where USERNAME='%n'
AuthColumnDef 0,User-Password,check
AuthColumnDef 1,Port-Limit,reply
AuthColumnDef 2,Framed-IP-Address,reply
AuthColumnDef 3,Simultaneous-Use,check
AccountingTable ACCOUNTING
AcctColumnDef USERNAME,User-Name
AcctColumnDef TIME_STAMP,Timestamp,integer-date
AcctColumnDef ACCTSTATUSTYPE,Acct-Status-Type
AcctColumnDef ACCTINPUTOCTETS,Acct-Input-Octets,integer
AcctColumnDef ACCTOUTPUTOCTETS,Acct-Output-Octets,integer
AcctColumnDef ACCTSESSIONID,Acct-Session-Id
AcctColumnDef ACCTSESSIONTIME,Acct-Session-Time,integer
AcctColumnDef ACCTTERMINATECAUSE,Acct-Terminate-Cause
AcctColumnDef NASIDENTIFIER,NAS-IP-Address
AcctColumnDef NASPORT,NAS-Port,integer
AcctColumnDef NASPORTTYPE,NAS-Port-Type
AcctColumnDef CONNECTRATE,Connect-Info
AcctColumnDef FRAMEDIPADDRESS,Framed-IP-Address
AcctColumnDef SERVICETYPE,Service-Type
AcctColumnDef CALLINGSTATIONID,Calling-Station-Id
AcctColumnDef CALLEDSTATIONID,Called-Station-Id
AddToReply Service-Type="Framed-User", \
Framed-Protocol="PPP", \
Framed-IP-Netmask = 255.255.255.255
AddToReply Class = SUBSCRIBERS
</AuthBy>
<AuthBy SQL>
Identifier LIMITED_20HRS
DBSource dbi:mysql:radius:xxx.xxx.xxx
DBUsername xxxxxxxxx
DBAuth xxxxxxxxx
DefaultSimultaneousUse 1
Description Database to use to authenticate 20 Hour users
FailureBackoffTime 5
Timeout 10
AuthSelect select PASSWORD,PORTLIMIT,STATICIP,SIMLOGIN,TIMELEFT
from LIMITED_20HRS where USERNAME='%n' AND ACTIVE='Y'
AuthColumnDef 0,User-Password,check
AuthColumnDef 1,Port-Limit,reply
AuthColumnDef 2,Framed-IP-Address,reply
AuthColumnDef 3,Simultaneous-Use,check
AuthColumnDef 4,Session-Timeout,reply
AccountingTable ACCOUNTING
AcctColumnDef USERNAME,User-Name
AcctColumnDef TIME_STAMP,Timestamp,integer-date
AcctColumnDef ACCTSTATUSTYPE,Acct-Status-Type
AcctColumnDef ACCTINPUTOCTETS,Acct-Input-Octets,integer
AcctColumnDef ACCTOUTPUTOCTETS,Acct-Output-Octets,integer
AcctColumnDef ACCTSESSIONID,Acct-Session-Id
AcctColumnDef ACCTSESSIONTIME,Acct-Session-Time,integer
AcctColumnDef ACCTTERMINATECAUSE,Acct-Terminate-Cause
AcctColumnDef NASIDENTIFIER,NAS-IP-Address
AcctColumnDef NASPORT,NAS-Port,integer
AcctColumnDef NASPORTTYPE,NAS-Port-Type
AcctColumnDef CONNECTRATE,Connect-Info
AcctColumnDef FRAMEDIPADDRESS,Framed-IP-Address
AcctColumnDef SERVICETYPE,Service-Type
AcctColumnDef CALLINGSTATIONID,Calling-Station-Id
AcctColumnDef CALLEDSTATIONID,Called-Station-Id
AcctSQLStatement update LIMITED_20HRS set
TIMELEFT=TIMELEFT-'%{Acct-Session-Time}' where USERNAME='%n'
AddToReply Service-Type="Framed-User", \
Framed-Protocol="PPP", \
Framed-IP-Netmask = 255.255.255.255
AddToReply Class = LIMITED_20HRS
</AuthBy>
<AuthBy SQL>
Identifier LIMITED_30HRS
DBSource dbi:mysql:radius:xxx.xxx.xxx
DBUsername xxxxxxxxx
DBAuth xxxxxxxxx
DefaultSimultaneousUse 1
Description Database to use to authenticate 30 Hour users
FailureBackoffTime 5
Timeout 10
AuthSelect select PASSWORD,PORTLIMIT,STATICIP,SIMLOGIN,TIMELEFT
from LIMITED_30HRS where USERNAME='%n' AND ACTIVE='Y'
AuthColumnDef 0,User-Password,check
AuthColumnDef 1,Port-Limit,reply
AuthColumnDef 2,Framed-IP-Address,reply
AuthColumnDef 3,Simultaneous-Use,check
AuthColumnDef 4,Session-Timeout,reply
AccountingTable ACCOUNTING
AcctColumnDef USERNAME,User-Name
AcctColumnDef TIME_STAMP,Timestamp,integer-date
AcctColumnDef ACCTSTATUSTYPE,Acct-Status-Type
AcctColumnDef ACCTINPUTOCTETS,Acct-Input-Octets,integer
AcctColumnDef ACCTOUTPUTOCTETS,Acct-Output-Octets,integer
AcctColumnDef ACCTSESSIONID,Acct-Session-Id
AcctColumnDef ACCTSESSIONTIME,Acct-Session-Time,integer
AcctColumnDef ACCTTERMINATECAUSE,Acct-Terminate-Cause
AcctColumnDef NASIDENTIFIER,NAS-IP-Address
AcctColumnDef NASPORT,NAS-Port,integer
AcctColumnDef NASPORTTYPE,NAS-Port-Type
AcctColumnDef CONNECTRATE,Connect-Info
AcctColumnDef FRAMEDIPADDRESS,Framed-IP-Address
AcctColumnDef SERVICETYPE,Service-Type
AcctColumnDef CALLINGSTATIONID,Calling-Station-Id
AcctColumnDef CALLEDSTATIONID,Called-Station-Id
AcctSQLStatement update LIMITED_30HRS set
TIMELEFT=TIMELEFT-'%{Acct-Session-Time}' where USERNAME='%n'
AddToReply Service-Type="Framed-User", \
Framed-Protocol="PPP", \
Framed-IP-Netmask = 255.255.255.255
AddToReply Class = LIMITED_30HRS
</AuthBy>
##Authentication Log##
<AuthLog FILE>
Identifier AuthLog
Filename %L/authlog
LogSuccess 0
LogFailure 1
SuccessFormat %l:%U:%P:OK:%1:%{Calling-Station-Id}
FailureFormat %l:%U:%P:FAIL:%1:%{Calling-Station-Id}
</AuthLog>
##Handlers for handling Accounting Requests##
<Handler Request-Type = Accounting-Request, Class = SUBSCRIBERS>
Description Handler for Handling Accounting Requests for
SUBSCRIBERS
RewriteUsername s/^([^@]+).*/$1/
AuthBy SUBSCRIBERS
</Handler>
<Handler Request-Type = Accounting-Request, Class = LIMITED_20HRS>
Description Handler for Handling Accounting Requests for
LIMITED_20HRS
RewriteUsername s/^([^@]+).*/$1/
AuthBy LIMITED_20HRS
</Handler>
<Handler Request-Type = Accounting-Request, Class = LIMITED_30HRS>
Description Handler for Handling Accounting Requests for
LIMITED_30HRS
RewriteUsername s/^([^@]+).*/$1/
AuthBy LIMITED_30HRS
</Handler>
##Handler for Authentication##
<Handler>
Description Default Handler for authenticating users
RejectHasReason
RewriteUsername s/^([^@]+).*/$1/
SessionDatabase RADONLINE
AuthLog AuthLog
AuthByPolicy ContinueWhileReject
AuthBy SUBSCRIBERS
AuthBy LIMITED_20HRS
AuthBy LIMITED_30HRS
</Handler>
##Realms##
<Realm checktime>
Description Realm for users to check their time
RejectHasReason
RewriteUsername s/^([^@]+).*/$1/
AuthByPolicy ContinueWhileReject
AccountingHandled
<AuthBy SQL>
Identifier CheckTime-SUBSCRIBERS
DBSource dbi:mysql:radius:xxx.xxx.xxx
DBUsername xxxxxxxxx
DBAuth xxxxxxxxx
Description Database to use to authenticate users
FailureBackoffTime 5
Timeout 10
AuthSelect select PASSWORD from SUBSCRIBERS where
USERNAME='%n'
AuthColumnDef 0,User-Password,check
</AuthBy>
<AuthBy SQL>
Identifier CheckTime-LIMITED_20HRS
DBSource dbi:mysql:radius:xxx.xxx.xxx
DBUsername xxxxxxxxx
DBAuth xxxxxxxxx
Description Database to use to authenticate 20 Hour
users
FailureBackoffTime 5
Timeout 10
AuthSelect select PASSWORD from LIMITED_20HRS where
USERNAME='%n'
AuthColumnDef 0,User-Password,check
</AuthBy>
<AuthBy SQL>
Identifier CheckTime-LIMITED_30HRS
DBSource dbi:mysql:radius:xxx.xxx.xxx
DBUsername xxxxxxxxx
DBAuth xxxxxxxxx
Description Database to use to authenticate 30 Hour
users
FailureBackoffTime 5
Timeout 10
AuthSelect select PASSWORD from LIMITED_30HRS where
USERNAME='%n'
AuthColumnDef 0,User-Password,check
</AuthBy>
</Realm>
##Session Database##
<SessionDatabase SQL>
AddQuery insert into RADONLINE (USERNAME, NASIDENTIFIER, NASPORT,
CONNECTRATE, ACCTSESSIONID, TIME_STAMP, FRAMEDIPADDRESS, NASPORTTYPE,
SERVICETYPE, CALLINGSTATIONID, CALLEDSTATIONID) values ('%u', '%N',
0%{NAS-Port}, '%{Connect-Info}', '%{Acct-Session-Id}', '%o',
'%{Framed-IP-Address}', '%{NAS-Port-Type}', '%{Service-Type}',
'%{Calling-Station-Id}', '%{Called-Station-Id}')
ClearNasQuery delete from RADONLINE where NASIDENTIFIER='%N'
CountNasSessionsQuery select ACCTSESSIONID from RADONLINE where
NASIDENTIFIER='%N'
CountQuery select NASIDENTIFIER, NASPORT, ACCTSESSIONID from RADONLINE
where USERNAME='%u'
DBSource dbi:mysql:radius:xxx.xxx.xxx
DBUsername xxxxxxxxx
DBAuth xxxxxxxxx
DeleteQuery delete from RADONLINE where NASIDENTIFIER='%N' and
NASPORT=0%{NAS-Port}
Description Database of currently online sessions (users)
FailureBackoffTime 5
Identifier RADONLINE
</SessionDatabase>
-----Original Message-----
From: Jaskaran Singh [mailto:jsingh at fdu.edu]
Sent: Friday, 07 June, 2002 15:43
To: 'Ronan Eckelberry'
Subject: RE: (RADIATOR) TimeBanking
Hello Ronan
I would like to take you up on your offer, if you could send me your
config file with the secrets taken out .
Thanks
Jack
-----Original Message-----
From: Ronan Eckelberry [mailto:radiator at gowebco.com]
Sent: Thursday, May 30, 2002 6:33 PM
To: 'Jaskaran Singh'; radiator at open.com.au
Subject: RE: (RADIATOR) TimeBanking
Jack,
Take a look at the mailing list archives and look for
"AcctSQLStatement" You should find quite a few in there matching what
you are looking for. That is the statement that is mostly used to
"update" the MySQL row when the user logs off.....If you cannot see what
you are looking for, I can send my config (Secrets and Addresses removed
to protect the guilty), and you may be able to go off of it. I would
recommend checking the archives first though. There is SOOOOOO much
info in there from Hugh and the other contributors. Also, as Hugh said,
the goodies directory has a lot in it, particularly the
"/goodies/blocktime.txt" example.
-Ronan
-----Original Message-----
From: owner-radiator at open.com.au [mailto:owner-radiator at open.com.au] On
Behalf Of Jaskaran Singh
Sent: Thursday, 30 May, 2002 15:58
To: radiator at open.com.au
Subject: (RADIATOR) TimeBanking
Hi,
Could anyone please lead me in the direction of the documentation as to
how to setup a maximum time and time left for a user in mysql database.
Thanks
Jack
===
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