<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 TRANSITIONAL//EN">
<HTML>
<HEAD>
  <META HTTP-EQUIV="Content-Type" CONTENT="text/html; CHARSET=UTF-8">
  <META NAME="GENERATOR" CONTENT="GtkHTML/3.30.3">
</HEAD>
<BODY>
On Wed, 2012-02-01 at 20:59 +0700, Fajar A. Nugraha wrote:
<BLOCKQUOTE TYPE=CITE>
<PRE>
2012/2/1 Antonio Modesto <<A HREF="mailto:modesto@isimples.com.br">modesto@isimples.com.br</A>>:
> But I don't want to use per-user pools, if it is possible,
> the better solution for me would be setting the pool based on some
> information of the NAS, because my routing topology doesn't permit a single
> pool for all cities that we attend.

It depends.

If your NAS sends some attribute that you can use (e.g
NAS-IP-Address), AND the number of possible values for that attribute
is small, AND you use FR2, you can just use unlang in authorize or
post-auth section to set pool-name. Manpage of unlang:
<A HREF="http://freeradius.org/radiusd/man/unlang.html">http://freeradius.org/radiusd/man/unlang.html</A>
Look at "if" and "update" keyword. Alan already wrote the "update" example.

Another possibility is to store the NAS-IP-Address (or whatever
attribute you use) <-> Pool-Name mapping in your own sql table, and
using unlang you can do something like

update control {
   Pool-Name := "%{sql: SELECT pool_name FROM nas_pool_name WHERE
nas_ip_address='%{NAS-IP-Address}'"
</PRE>
</BLOCKQUOTE>
<BR>
Yes, good idea, I can create a custom table for that. I just need to understand how this stuff (authorize, post-auth) works, I'm a little lost with these things. So far I didn't get setting the pool_name to a custom name, I am testing with the default "sqlippool".<BR>
<BR>
My production radius server is running freeradius 1.1.8, I installed freeradius 2 in another server with another SQL database and copied the configuration files from the production server to the test server and changed some stuff to get it running, then I am doing these tests in this server. I don't know if Freeradius 2.x are compatible with freeradius 1.1.8 configuration files.<BR>
<BR>
<BR>
Thanks and sorry for the amount of questions.<BR>
<BR>
Regards.<BR>
<BR>
<BLOCKQUOTE TYPE=CITE>
<PRE>
}

... where nas_pool_name is your own custom table.

</PRE>
</BLOCKQUOTE>
<BR>
</BODY>
</HTML>