[RADIATOR] Client MAC:xx-xx-xx-xx-xx-xx

Christian Kratzer ck-lists at cksoft.de
Mon Mar 28 06:39:47 CDT 2011


Hi Heikki,

On Mon, 28 Mar 2011, Heikki Vatiainen wrote:

> On 03/28/2011 01:30 PM, Adam Bishop wrote:
>
>> Which attribute does radiator use for comparison when using
>> MAC-filtering on a client block?  Trying to pin down why one of our
>> clients isn't being picked up by the client block we have set:
>
> The attribute is Calling-Station-Id. Its format is like what you have
> below with hyphens being optional.

I just had a look at the code myself. It seems like it uses Called-Station-Id:

Function find in Client.pm

   #####################################################################
   # Find a Client with the packed Host same as the RecvFrom host
   # If not found, try to find one with the MAC address given in
   # Called-Station-Id
   # If not found, try to find one for DEFAULT
   # REVISIT: Should probably add regexp matching too?
   sub find
   {
       my ($p) = @_;

       my ($client_port, $client_addr) =
   Radius::Util::unpack_sockaddr_in($p->{RecvFrom});
       my $ret = $Radius::Client::clients{$client_addr};
       # Look for a IPV4 CIDR match.
       $ret = findCidrAddress($client_addr)
 	  unless defined $ret;
       if (!defined $ret)
       {
 	  # Try to deduce a MAC address from Called-Station-Id
 	  no warnings "uninitialized";
>>>	  my $mac = $p->getAttrByNum($Radius::Radius::CALLED_STATION_ID);
 	  $ret = $Radius::Client::clients{'MAC:' . $mac}
 	      if ($mac =~
   /^[0-9a-fA-F]{2}-?[0-9a-fA-F]{2}-?[0-9a-fA-F]{2}-?[0-9a-fA-F]{2}-?[0-9a-fA-F]{2}-?[0-9a-fA-F]{2}$/);

 	  # Still nothing, fall back to the default
 	  $ret = $Radius::Client::clients{DEFAULT}
 	      unless defined $ret;
       }
       return $ret;
   }

This is most propably the access points mac address on the air which is
not necessarily the same as the mac adresse seen on the ethernet.

Greetings
Christian

-- 
Christian Kratzer                      CK Software GmbH
Email:   ck at cksoft.de                  Wildberger Weg 24/2
Phone:   +49 7032 893 997 - 0          D-71126 Gaeufelden
Fax:     +49 7032 893 997 - 9          HRB 245288, Amtsgericht Stuttgart
Web:     http://www.cksoft.de/         Geschaeftsfuehrer: Christian Kratzer


More information about the radiator mailing list