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!
Здравствуйте, Ilya. Вы писали 6 сентября 2012 г., 21:52:23:
Hello!
We are using freeradius as dhcp server about two years. Its working wery well, but.
...
Heh, sorry, I found the solution =) Somethink like this for example, to ignore vlan #1 (default on most devices): if( "%{DHCP-Relay-Circuit-Id}" =~ /^0x([0-9a-f]{4})0001([0-9a-f]{4})$/i ) { reject } -- С уважением, Масандилов Илья Руководитель IT-отдела ООО "КДМС" 8(495) 585-07-37 mailto:wingman@ip-home.net
Heh, sorry, I found the solution =) Somethink like this for example, to ignore vlan #1 (default on most devices):
if( "%{DHCP-Relay-Circuit-Id}" =~ /^0x([0-9a-f]{4})0001([0-9a-f]{4})$/i ) { reject }
Wow. After using this code ^ and also this (filter 25-28 ports, many switches relaying transit dhcp packets, not from user ports ;( ): if( "%{DHCP-Relay-Circuit-Id}" =~ /^0x([0-9a-f]{8})001([9|a|b|c])$/i ) { handled } CPU use by radiusd fell from 70% to 10-15. Great. Thank you Alan for great dhcp functional ;)
Alan, Does the 3.0 code have the latest DHCP functionalities? David -----Original Message----- From: freeradius-users-bounces+davidp=wirelessconnections.net@lists.freeradius.org [mailto:freeradius-users-bounces+davidp=wirelessconnections.net@lists.freera dius.org] On Behalf Of Alan DeKok Sent: Friday, September 7, 2012 7:40 AM To: FreeRadius users mailing list Subject: Re: Freeradius as dhcp; parsing option82 Ilya A. Masandilov wrote:
CPU use by radiusd fell from 70% to 10-15. Great. Thank you Alan for great dhcp functional ;)
You're welcome. Version 2.2.0 should have increased DHCP functionality. Alan DeKok. - List info/subscribe/unsubscribe? See http://www.freeradius.org/list/users.html
participants (3)
-
Alan DeKok -
David Peterson -
Ilya A. Masandilov