[RADIATOR] preClientHook problem using ClientListSQL from version 3.15 to version 4.3.1
Dario Aguilar
daguilar at arnet.net.ar
Fri Jan 9 07:27:14 CST 2009
Hi Hugh,
As you can see in the script, we need to use the
'NAS-IP-Address' and 'NAS-Port' attributes in our preClientHook.cfg and both
values will not be decrypted because this should be done now in a context of
a particular Client. The problem is that we cannot declare the parameter
ClientHook into the ClientListSQL clause because this dont even exist so I
don´t know how can I call preClientHook script to execute for all our SQL
clients and not to each one in particular. Maybe Mikey´s added support for
ClientHook in ClientList SQLClientHook should help us to resolve this but
how can we implement this to satisfy our needs correctly?
best regards,
Dario.
Hugh Irvine wrote:
>
>
> Hello Dario -
>
> Can you please tell me what problems you are having?
>
> regards
>
> Hugh
>
>
> On 8 Jan 2009, at 04:49, Dario Aguilar wrote:
>
>>
>> Hi, first of all I want to clarify that I am a new user of Radiator
>> and my
>> knowledge of Perl language is very poor. We are trying to move from
>> version
>> 3.15 to 4.3.1 and some problems a problem appered to us with the old
>> Global
>> "preClientHook" statement in the new version. How should I call
>> PreClientHook.cfg to work in using ClientListSQL ?. I´ve already
>> finish
>> reading the revision history of versions 4.3 and 4.3.1 and the
>> reference
>> manual but I still have very clear how to implement this in our
>> server.
>>
>> Our radius.conf looks something like this:
>> -------------------------------------------------------------
>> <ClientListSQL>
>> DBSource dbi:Oracle:%{GlobalVar:DBInstance}
>> DBUsername %{GlobalVar:DBUsername}
>> DBAuth %{GlobalVar:DBAuth}
>> DBSource dbi:Oracle:%{GlobalVar:DBInstance}
>> DBUsername %{GlobalVar:DBUsername}
>> DBAuth %{GlobalVar:DBAuth}
>> GetClientQuery SELECT nas_ip_address,secret from
>> tbl_radclient WHERE nas_ip_address IS NOT NULL and secret IS NOT NULL
>> BackupFilename
>> %D/clientlist.%{GlobalVar:CodeType}.%{GlobalVar:IpAddress}.dat
>> RefreshPeriod 3600
>> Timeout 2
>> FailureBackoffTime 0
>> ConnectionHook file:"%D/ConnectionHook.cfg"
>> </ClientListSQL>
>>
>> PreClientHook file:"%D/PreClientHook.cfg"
>> -------------------------------------------------
>>
>> PreClientHook.cfg----->>>
>>
>> sub {
>> my $p=${$_[0]};
>> my $nasip=$p->get_attr('NAS-IP-Address');
>> my $ip=&Radius::Util::format_special('%c', $p);
>> my $nasport=$p->get_attr('NAS-Port');
>> my $callid=$p->get_attr('Calling-Station-Id');
>>
>> &main::log($main::LOG_DEBUG,'Into PreClientHook');
>> &main::log($main::LOG_DEBUG,"NASIP=[$nasip] NASPORT=[$nasport]
>> SOURCE_IP=[$ip] CallId=[$callid]");
>> if($ip ne '192.168.0.1' and $ip ne '192.168.0.2') {
>> $p->change_attr('NAS-IP-Address',$ip) if $nasip ne $ip;
>> }
>>
>> $p->add_attr('NAS-Port',$callid) unless defined $nasport;
>> $p->delete_attr('State');
>> if ($p->code eq 'Accounting-Request' &&
>> $p->get_attr('Acct-Status-Type') eq 'Stop') {
>> my %ascend2ietf = (
>> 'remoteEndHungup' => 'User-Request',
>> 'pppRcvTerminate' => 'User-Request',
>> 'sessTimeOut' => 'Session-Timeout',
>> '240' => 'Host-Request',
>> );
>>
>> my $ascend_disconnect_cause =
>> $p->get_attr('Ascend-Disconnect-Cause');
>> if($ascend_disconnect_cause) {
>> my $newval=
>> $ascend2ietf{$ascend_disconnect_cause};
>> $newval='Lost-Carrier'
>> unless defined $newval;
>> $p->change_attr('Acct-Terminate-Cause',
>> $newval);
>> }
>> }
>> }
>> -------------------------------------------
>>
>> thanks,
>> Dario Aguilar
>> --
>> View this message in context:
>> http://www.nabble.com/preClientHook-problem-using-ClientListSQL-from-version-3.15-to-version-4.3.1-tp21336689p21336689.html
>> Sent from the Radiator - General mailing list archive at Nabble.com.
>>
>>
>> _______________________________________________
>> radiator mailing list
>> radiator at open.com.au
>> http://www.open.com.au/mailman/listinfo/radiator
>
>
>
> NB:
>
> Have you read the reference manual ("doc/ref.html")?
> Have you searched the mailing list archive
> (www.open.com.au/archives/radiator)?
> Have you had a quick look on Google (www.google.com)?
> Have you included a copy of your configuration file (no secrets),
> together with a trace 4 debug showing what is happening?
> Have you checked the RadiusExpert wiki:
> http://www.open.com.au/wiki/index.php/Main_Page
>
> --
> Radiator: the most portable, flexible and configurable RADIUS server
> anywhere. Available on *NIX, *BSD, Windows, MacOS X.
> Includes support for reliable RADIUS transport (RadSec),
> and DIAMETER translation agent.
> -
> Nets: internetwork inventory and management - graphical, extensible,
> flexible with hardware, software, platform and database independence.
> -
> CATool: Private Certificate Authority for Unix and Unix-like systems.
>
>
>
> _______________________________________________
> radiator mailing list
> radiator at open.com.au
> http://www.open.com.au/mailman/listinfo/radiator
>
>
--
View this message in context: http://www.nabble.com/preClientHook-problem-using-ClientListSQL-from-version-3.15-to-version-4.3.1-tp21336689p21372284.html
Sent from the Radiator - General mailing list archive at Nabble.com.
More information about the radiator
mailing list