Newbie and Sqlippool

Fajar A. Nugraha list at fajar.net
Wed Feb 1 14:59:39 CET 2012


2012/2/1 Antonio Modesto <modesto at isimples.com.br>:
> 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:
http://freeradius.org/radiusd/man/unlang.html
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}'"
}

... where nas_pool_name is your own custom table.

-- 
Fajar



More information about the Freeradius-Users mailing list