<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<meta http-equiv="content-type" content="text/html; charset=UTF-8">
</head>
<body text="#000000" bgcolor="#ffffff">
<font size="-1">hi<br>
<br>
i have 2 virtual servers active: <br>
default <br>
dynamic-clients <br>
<br>
i wan to lookup every nas via sql </font><font size="-1">dynamic-clients.
<br>
<br>
my dynamic-clients configuration file<br>
<br>
client dynamic {<br>
ipaddr = 0.0.0.0<br>
netmask = 0<br>
lifetime = 3600<br>
}<br>
<br>
server dynamic_client_server {<br>
<br>
authorize {<br>
<br>
if ("%{sql: SELECT nasname FROM nas WHERE nasname =
'%{Packet-Src-IP-Address}'}") {<br>
update control {<br>
#<br>
# Echo the IP.<br>
FreeRADIUS-Client-IP-Address =
"%{Packet-Src-IP-Address}"<br>
<br>
FreeRADIUS-Client-Shortname = "%{sql: SELECT
shortname FROM nas WHERE nasname = '%{Packet-Src-IP-Address}'}"<br>
<br>
FreeRADIUS-Client-Secret = "%{sql: SELECT secret
FROM nas WHERE nasname = '%{Packet-Src-IP-Address}'}"<br>
<br>
FreeRADIUS-Client-NAS-Type = "%{sql: SELECT type
FROM nas WHERE nasname = '%{Packet-Src-IP-Address}'}"<br>
<br>
FreeRADIUS-Client-Virtual-Server = "%{sql: SELECT
server FROM nas WHERE nasname = '%{Packet-Src-IP-Address}'}"<br>
}<br>
<br>
}<br>
<br>
ok<br>
}<br>
}<br>
<br>
doesn't matter if i have NULL or just empty string or default in </font><font
size="-1">column server in table nas</font> freeradius in -X mode
says:<br>
<br>
rad_recv: Access-Request packet from host 10.194.3.239 port 35419,
id=31, length=85<br>
Service-Type = Login-User<br>
User-Name = "ukasz"<br>
User-Password = "dupa"<br>
Calling-Station-Id = "10.194.3.230"<br>
NAS-Identifier = "admini-pokoj"<br>
NAS-IP-Address = 10.194.3.239<br>
server {<br>
No such virtual server ""<br>
} # server <br>
Using Post-Auth-Type Reject<br>
No such virtual server ""<br>
<br>
if i comment the line with #<br>
<font size="-1">FreeRADIUS-Client-Virtual-Server = "%{sql: SELECT
server FROM nas WHERE nasname = '%{Packet-Src-IP-Address}'}"<br>
<br>
freeradius lookups the default server but it is not whot i want.<br>
<br>
i have found a dirty hack how to solve this problem:<br>
<br>
i have basicly created a file default-default file in
/etc/sites-enabled/ and it countains:<br>
<br>
server default-default {<br>
$INCLUDE ${confdir}/sites-available/default<br>
}<br>
<br>
and when i type default-default in sql collumn server, my
authentication requests goes to default server.<br>
<br>
maybe i am doing something worong. i could not find any info how
to refer to default virtual server in sql.<br>
<br>
<br>
dpkg -l | grep freera<br>
ii freeradius
2.1.10+dfsg-2 a high-performance and highly
configurable RADIUS server<br>
ii freeradius-common
2.1.10+dfsg-2 FreeRADIUS common files<br>
ii freeradius-mysql
2.1.10+dfsg-2 MySQL module for FreeRADIUS
server<br>
ii freeradius-utils
2.1.10+dfsg-2 FreeRADIUS client utilities<br>
ii libfreeradius2
2.1.10+dfsg-2 FreeRADIUS shared library<br>
<br>
cat /etc/debian_version <br>
6.0.1<br>
<br>
</font><br>
<font size="-1"><br>
<br>
</font>
</body>
</html>