[fixed version] rlm_perl and tagged attributes problem
tnt at kalik.net
tnt at kalik.net
Tue Mar 31 13:16:35 CEST 2009
>[Update: fixed script so that it won't set incorrect attributes, but
>problem persist]
>
>I'm trying to set up FreeRADIUS with rlm_perl module to have ability
>to interoperate with our billing/provisioning system.
>
>FreeRADIUS version:
>
># radiusd -v
>radiusd: FreeRADIUS Version 1.1.7, for host amd64-portbld-freebsd6.3,
>built on Jan 15 2009 at 18:36:52
>
>Perl version:
>
># perl -V
>Summary of my perl5 (revision 5 version 8 subversion 8) configuration:
> Platform:
> osname=freebsd, osvers=6.3-rc2, archname=amd64-freebsd
>
>
>We are using Juniper ERX-310 BRAS to terminate our customers and to
>configure policies and so on, he need few attributes to be tagged.
>
>Here is what normal session should be like to:
>
>[never at nemo ~]$ radtest admin test 127.0.0.1 2 testing123
>Sending Access-Request of id 229 to 127.0.0.1 port 1812
> User-Name = "admin"
> User-Password = "test"
> NAS-IP-Address = 255.255.255.255
> NAS-Port = 2
>rad_recv: Access-Accept packet from host 127.0.0.1:1812, id=127, length=126
> ERX-Qos-Profile-Name = "SP_Tele_Internet"
> ERX-Qos-Parameters = "internet_tr_value 2097152"
> Framed-IP-Address = 10.0.112.2
> Framed-IP-Netmask = 255.255.255.255
> ERX-Service-Statistics:1 = time-volume
> ERX-Service-Activate:1 = "telesys(1048576)"
>
>Please note ERX-Service-Statistics:1 and ERX-Service-Activate:1 attributes.
>
>I have minimized code in Perl module to achieve this, to exclude any
>possibility of our system influence:
>
>sub authorize {
> if (($RAD_REQUEST{'User-Name'} eq 'admin') and
>($RAD_REQUEST{'User-Password'} eq 'test')) {
> $RAD_REPLY{'ERX-Service-Activate:1'} = 'telesys(1048576)';
> $RAD_REPLY{'ERX-Service-Statistics:1'} = 'time-volume';
> $RAD_REPLY{'ERX-Qos-Parameters'} = "internet_tr_value 2097152";
> $RAD_REPLY{'ERX-Qos-Profile-Name'} = "SP_Tele_Internet";
> $RAD_REPLY{'Framed-IP-Address'} = '10.0.112.2';
> $RAD_REPLY{'Framed-IP-Netmask'}= "255.255.255.255";
> return RLM_MODULE_OK;
> };
>}
>
>Now let me to describe what happens.
>When I restart radiusd and issue 1st radius Access-Request packet, it
>returns attributes as expected. But the next one returns this:
>
>$ radtest admin test 127.0.0.1 2 testing123
>Sending Access-Request of id 32 to 127.0.0.1 port 1812
> User-Name = "admin"
> User-Password = "test"
> NAS-IP-Address = 255.255.255.255
> NAS-Port = 2
>rad_recv: Access-Accept packet from host 127.0.0.1:1812, id=37, length=125
> ERX-Qos-Profile-Name = "SP_Tele_Internet"
> ERX-Qos-Parameters = "internet_tr_value 2097152"
> Framed-IP-Address = 10.0.112.2
> Framed-IP-Netmask = 255.255.255.255
> ERX-Service-Statistics:0 = time-volume
> ERX-Service-Activate:0 = "telesys(1048576)"
>
>Please note ":0" after 2 last ERX-* attributes, which is a) incorrect,
>b) in perl code it is clearly written as ":1".
>
I can't replicate this in 2.1.3. Upgrade - it has been fixed.
Ivan Kalik
Kalik Informatika ISP
More information about the Freeradius-Users
mailing list