rlm_perl and dynamic_clients

Steven Eksteen steve at saoirse.co.za
Tue Aug 28 15:12:24 CEST 2012


Hi,

I was wondering how would I use "Packet-Src-IP-Address" using Perl for
Dynamic Clients. I thought it might be part of the RAD_REQUEST hash.
If some direction could be made as to setting
"FreeRADIUS-Client-Shortname", "FreeRADIUS-Client-Secret", etc. too I
would be very grateful. I already have Perl working for the normal AAA
functions. This just doesn't appear to work the same way. I am not a
Perl developer in the slightest so apologies in advance if this is a
monumentally stupid question.

Thank you

---

FreeRADIUS Version 2.1.10, for host x86_64-redhat-linux-gnu

---

client dynamic {
        ipaddr = 0.0.0.0
        netmask = 0
        dynamic_clients = dynamic_client_server
        lifetime = 3600
}

server dynamic_client_server {
        authorize {
                dynamic-clients-pl
        }
}

---

use strict;
use Data::Dumper;

use vars qw(%RAD_REQUEST);

use constant RLM_MODULE_REJECT => 0;
use constant RLM_MODULE_FAIL => 1;
use constant RLM_MODULE_OK => 2;
use constant RLM_MODULE_HANDLED => 3;
use constant RLM_MODULE_INVALID => 4;
use constant RLM_MODULE_USERLOCK => 5;
use constant RLM_MODULE_NOTFOUND => 6;
use constant RLM_MODULE_NOOP => 7;
use constant RLM_MODULE_UPDATED => 8;
use constant RLM_MODULE_NUMCODES => 9;

sub authorize {
  &log_request_attributes;

  return RLM_MODULE_FAIL;
}

sub log_request_attributes {
  for (keys %RAD_REQUEST) {
    &radiusd::radlog(1, "RAD_REQUEST: $_ = $RAD_REQUEST{$_}");
  }
}
---

rad_recv: Access-Request packet from host 41.132.69.140 port 51951,
id=31, length=212
server dynamic_client_server {
} # server dynamic_client_server
Ignoring request to authentication address * port 1812 as server r9
from unknown client 41.132.69.140 port 51951
Ready to process requests.

---


More information about the Freeradius-Users mailing list