Freeradius GGSN->Postgresql Based upon a SELECT it will trigger a specific IP Pool
Phil Mayers
p.mayers at imperial.ac.uk
Tue May 24 15:02:29 CEST 2011
On 24/05/11 13:44, Pedro Costa wrote:
> Hi,
>
> I'm new to Freeradius and i am trying to figure a way to use Freeradius
> to Authenticate a user through a CISCO GGSN in where the GGSN will send
> the IMSI to the Freeradius and the Freeradius will connect to a
> Postgresql DB doing a SELECT on 2 tables and will receive a Language
> that the IMSI/User has stored in the database, the Freeradius will then
> use the language (ex.: French or German) and choose the specific IP Pool
> for that Language.
>
> I'm currently trying to connect to Postgresql but i'm having doubt on
> how can i acheive this purpose of selecting a ip pool based upon the
> output of the SELECT command performed on the DB.
Yes. You can execute a SQL query from "unlang", and use this to set the
Pool-Name attribute; then use the sqlippool or other module to allocate
IPs from the pool.
e.g.
authorize {
...
update control {
Tmp-String-0 := "%{sql:select language from ... where ...}"
}
if (control:Tmp-String-0 == "english") {
update control {
Pool-Name := English-IP-Pool
}
}
else {
update control {
Pool-Name := French-IP-Pool
}
}
...
}
post-auth {
...
sqlippool
...
}
More information about the Freeradius-Users
mailing list