how to refer to default virual server via dynamic clients sql lookup

Łukasz Kostka ukasz83 at gmail.com
Wed Aug 10 14:21:10 CEST 2011


hi

i have 2 virtual servers active:
default
dynamic-clients

i wan to lookup every nas via sql dynamic-clients.

my dynamic-clients configuration file

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

server dynamic_client_server {

     authorize {

         if ("%{sql: SELECT nasname FROM nas WHERE nasname = 
'%{Packet-Src-IP-Address}'}") {
             update control {
                 #
                 #  Echo the IP.
                 FreeRADIUS-Client-IP-Address = "%{Packet-Src-IP-Address}"

                 FreeRADIUS-Client-Shortname = "%{sql: SELECT shortname 
FROM nas WHERE nasname = '%{Packet-Src-IP-Address}'}"

                 FreeRADIUS-Client-Secret = "%{sql: SELECT secret FROM 
nas WHERE nasname = '%{Packet-Src-IP-Address}'}"

                 FreeRADIUS-Client-NAS-Type = "%{sql: SELECT type FROM 
nas WHERE nasname = '%{Packet-Src-IP-Address}'}"

                 FreeRADIUS-Client-Virtual-Server = "%{sql: SELECT 
server FROM nas WHERE nasname = '%{Packet-Src-IP-Address}'}"
             }

         }

         ok
     }
}

doesn't matter if i have NULL or just empty string or default in column 
server in table nas freeradius in -X mode says:

rad_recv: Access-Request packet from host 10.194.3.239 port 35419, 
id=31, length=85
     Service-Type = Login-User
     User-Name = "ukasz"
     User-Password = "dupa"
     Calling-Station-Id = "10.194.3.230"
     NAS-Identifier = "admini-pokoj"
     NAS-IP-Address = 10.194.3.239
server  {
No such virtual server ""
} # server
Using Post-Auth-Type Reject
No such virtual server ""

if i comment the line  with #
FreeRADIUS-Client-Virtual-Server = "%{sql: SELECT server FROM nas WHERE 
nasname = '%{Packet-Src-IP-Address}'}"

freeradius lookups the default server but it is not whot i want.

i have found a dirty hack how to solve this problem:

i have basicly created a file default-default file in 
/etc/sites-enabled/ and it countains:

server default-default {
$INCLUDE ${confdir}/sites-available/default
}

and when i type default-default in sql collumn server, my authentication 
requests goes to default server.

maybe i am doing something worong. i could not find any info how to 
refer to default virtual server in sql.


dpkg -l | grep freera
ii  freeradius                           
2.1.10+dfsg-2                     a high-performance and highly 
configurable RADIUS server
ii  freeradius-common                    
2.1.10+dfsg-2                     FreeRADIUS common files
ii  freeradius-mysql                     
2.1.10+dfsg-2                     MySQL module for FreeRADIUS server
ii  freeradius-utils                     
2.1.10+dfsg-2                     FreeRADIUS client utilities
ii  libfreeradius2                       
2.1.10+dfsg-2                     FreeRADIUS shared library

cat /etc/debian_version
6.0.1




-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.freeradius.org/pipermail/freeradius-users/attachments/20110810/03449443/attachment.html>


More information about the Freeradius-Users mailing list