Freeradius GGSN->Postgresql Based upon a SELECT it will trigger a specific IP Pool
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. What is the best and/or simplest way to achieve this? Is it through Perl? Or can the Freeradius connect straight to the Postgres DB and receive the Select output and be able to use the respective IP Pool, if so how can i achieve this? Hope someone can help, Best Regards, P.M.R.C.
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 ... }
participants (2)
-
Pedro Costa -
Phil Mayers