On Mon, Apr 05, 2004 at 08:16:24PM +0300, Kostas Zorbadelos wrote:
> Hello to everyone.
> I have the following problem where I work. We have a user, lets say
> kzorba that is an ADSL user and has a specific profile (check and
> reply attributes). We want to limit the Simultaneous-Use of
> the user for this service to 1. We also want for the same user to be
> able to use an ISDN 128 backup connection in case his ADSL line has a
> problem. I this case our user has a different profile and
> Simultaneous-Use 2 (in order to be able to login twice for the 2 isdn
> channels). So the question is: how can I lock the user in a way that
> when he uses his ADSL connection, not to be able to connect with ISDN
> at all (that's easy since Simultaneous-Use is 1 in this case and won't
> be allowed to login for anything else) and the opposite (when in as an
> ISDN not to be able to use the ADSL). 
> Any suggestions are highly appreciated.

You could do it in authorize {} section instead of session {}.
Say you have defined 2 attrs (e.g. of type integer): ADSL-Up and ISDN-Up.
Assuming you have accounting in SQL, you could do:

ADSL-Up := `%{sql:SELECT count(*) FROM radacct WHERE UserName = '%u' AND NASPortType = 
'Ethernet' AND AcctStopTime IS NULL}`
ISDN-Up := `%{sql:SELECT count(*) FROM radacct WHERE UserName = '%u' AND NASPortType = 
'ISDN' AND AcctStopTime IS NULL}`

(Note the backquotes; the behavour can change soon.)

Then put 2 entries in "users" file:
DEFAULT NAS-Port-Type == ISDN, ADSL-Up > 0, Auth-Type := Reject
        Reply-Message := "You have your ADSL up, ISDN connections disabled"

DEFAULT NAS-Port-Type == Ethernet, ISDN-Up > 0, Auth-Type := Reject
        Reply-Message := "To use ADSL, first stop your backup ISDN connections"


-- 
Fduch M. Pravking

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

Reply via email to