Freeradius as dhcp; parsing option82

Ilya A. Masandilov wingman at ip-home.net
Thu Sep 6 19:52:23 CEST 2012


Hello!

We  are  using  freeradius as dhcp server about two years. Its working
wery well, but.

We have all the DHCP logic written in rlm_perl script.

Now  we  have load ~900-1200 dhcp queries per sec, but 70% of them are
ignored    (dependents   of   a   vlan   in   option   82   (part   of
DHCP-Relay-Circuit-Id)).

I would like to parse circuit-id by unlang, to not to transfer most of
the queries in Perl script.

In Perl, I do it like this:

my $hex = substr, $RAD_REQUEST{'DHCP-Relay-Circuit-Id'}, 6, 8;
my $vlan = hex(hex);
$hex = substr,  $RAD_REQUEST{'DHCP-Relay-Circuit-Id'}, 10, 12;
my $port = hex($hex);

But i can't find suggestion in unlang...
Is there a way to do this by unlang without using sql:unhex or any external modules?

Thank you!



More information about the Freeradius-Users mailing list