Hello Simon -
On Tue, 04 Jul 2000, Simon Hackett wrote:
> Hello, fellow Radiators,
>
> We use a PreClientHook (shown below for interest), in order to do
> something that we find highly useful here - using the called number
> as a match string to determine a default realm name.
>
> What the PreClientHook does is look up a little text file listing
> regular expressions to match (for example, 00$ to match a number
> ending in 00, or a full number, or anything in between, and just '.'
> to specify default behavior), and a corresponding realm name to
> append to the username if there is no realm explicitly specified by
> the user.
>
> This is used to allow us to offer outsourced dialup access to others,
> where we assign a distinct indial number to each customer, allowing
> their users to magically grow the correct realm name based on the
> number they were told to dial.
>
> This then makes it very easy to handle the requests with a Realm
> statement for each realm we know about, without worrying about the
> Called-Station-Id other than in the PreClientHook.
>
> My question is simply this: Is there any more 'direct' way to achieve
> the inference of a realm name to use, based on the Called-Station-Id,
> via direct statements in the radiator configuration file?
>
> It works fine, by the way, I'm just in search of a deeper
> understanding of the many and mysterious features of Radiator by
> asking about alternatives that might do something similar. It may
> just be possible that we're doing this the best way we can already
> (it certainly does work very well for us).
>
> Cheers,
> Simon
>
> PreClientHook sub { \
> my($rm, $pn, $un, $rre, $rrm); \
> \
> $un = ${$_[0]}->getUserName; \
> return if($un =~ m/\@/); \
> $pn = ${$_[0]}->get_attr('Called-Station-Id'); \
> $pn = "." if(!defined($pn)); \
> open(FH, "/local/radius/radconfig/phonearray.txt"); \
> while(<FH>) { \
> chomp; \
> ($rre, $rrm) = split(/\s+/, $_); \
> if($pn =~ m/$rre/) { \
> $rm = $rrm; \
> last; \
> } \
> } \
> close(FH); \
> ${$_[0]}->changeUserName($un . "@" . $rm); \
> }
>
Included with Radiator 2.16.1 are two useful additions in the goodies directory:
CalledStationId.pm and csid.cfg. CalledStationId.pm is a module that you can
add to your Radiator installation which allows you to set up Realm-like clauses
that match on the number that is dialled, and csid.cfg is an example
configuration file. You could use these to construct the equivalent of a
<Handler Called-Station-Id = ......>, but that matches on a table lookup
instead of on a table walk.
Doing the above would mean you could avoid the Realm manipulation entirely.
hth
Hugh
--
Radiator: the most portable, flexible and configurable RADIUS server
anywhere. SQL, proxy, DBM, files, LDAP, NIS+, password, NT, Emerald,
Platypus, Freeside, Interbiller, TACACS+, PAM, external, etc, etc.
Available on Unix, Linux, FreeBSD, Windows 95/98/2000, NT, MacOS X.
===
Archive at http://www.starport.net/~radiator/
Announcements on [EMAIL PROTECTED]
To unsubscribe, email '[EMAIL PROTECTED]' with
'unsubscribe radiator' in the body of the message.