[sqlippool]IP address could not be allocated as no pool exists with that name
Hello list! Could someone please help me with a problem regarding freeradius sqlippool module? I'm migrating to FreeRADIUS Version 2.1.10 with MySQL 5.1.73-1 running on a Debian GNU/Linux 6 The content of my radcheck table is something like: mysql> select * from radcheck where UserName = 'lucasmenezes'; +-------+-------------------------+--------------------+----------------+----+ | id | UserName | Attribute | Value | op | +-------+-------------------------+--------------------+----------------+----+ | 15643 | lucasmenezes | Cleartext-Password | 12110 | := | | 22342 | lucasmenezes | Pool-Name | PONTALNORTE_02 | := | +-------+-------------------------+--------------------+----------------+----+ 2 rows in set (0.00 sec) When the mentioned user tries to authenticate, I get the error message "IP address could not be allocated as no pool exists with that name". The user receives Login OK, but radius releases IP 0.0.0.0 to her/him. Here is an **example** of my radippool table: mysql> select * from radcheck where UserName = 'lucasmenezes'; +-------+----------------+-----------------+--------------+-----------------+-------------------+---------------------+-------------------------+-------------------+ | id | pool_name | FramedIPAddress | NASIPAddress | CalledStationId | CallingStationID | expiry_time | username | pool_key | +-------+----------------+-----------------+--------------+-----------------+-------------------+---------------------+-------------------------+-------------------+ | 64171 | PONTALNORTE_02 | 187.44.69.244 | 187.44.64.58 | | 00:0C:43:B4:1B:81 | 2015-10-27 16:00:10 | lucasmenezes | 00:0C:43:B4:1B:81 | +-------+----------------+-----------------+--------------+-----------------+-------------------+---------------------+-------------------------+-------------------+ 1 row in set (0.00 sec) For some reason, I noticed the %{control:Pool-Name} section in the SQL query isn't being resolved and, because that, SQL query doesn't return any results. Please let me post bellow the output of freeradius -X regarding that situation: Login OK: [lucasmenezes] (from client MK_Pontal port 15728946 cli 00:0C:43:B4:1B:81) # Executing section post-auth from file /etc/freeradius/sites-enabled/default +- entering group post-auth {...} rlm_sql (sql): Reserving sql socket id: 110 [sqlippool] expand: %{User-Name} -> lucasmenezes [sqlippool] sql_set_user escaped user --> 'lucasmenezes' [sqlippool] expand: START TRANSACTION -> START TRANSACTION [sqlippool] expand: UPDATE radippool SET nasipaddress = '', pool_key = 0, callingstationid = '', username = '', expiry_time = NULL WHERE expiry_time <= NOW() - INTERVAL 1 SECOND AND nasipaddress = '%{Nas-IP-Address}' -> UPDATE radippool SET nasipaddress = '', pool_key = 0, callingstationid = '', username = '', expiry_time = NULL WHERE expiry_time <= NOW() - INTERVAL 1 SECOND AND nasipaddress = '187.44.64.58' [sqlippool] expand: SELECT framedipaddress FROM radippool WHERE pool_name = '%{control:Pool-Name}' AND (expiry_time < NOW() OR expiry_time IS NULL) ORDER BY (username <> '%{User-Name}'), (callingstationid <> '%{Calling-Station-Id}'), expiry_time LIMIT 1 FOR UPDATE -> SELECT framedipaddress FROM radippool WHERE pool_name = '' AND (expiry_time < NOW() OR expiry_time IS NULL) ORDER BY (username <> 'lucasmenezes'), (callingstationid <> '00:0C:43:B4:1B:81'), expiry_time LIMIT 1 FOR UPDATE [sqlippool] SQL query did not return any results [sqlippool] expand: COMMIT -> COMMIT [sqlippool] expand: SELECT id FROM radippool WHERE pool_name='%{control:Pool-Name}' LIMIT 1 -> SELECT id FROM radippool WHERE pool_name='' LIMIT 1 [sqlippool] SQL query did not return any results rlm_sql (sql): Released sql socket id: 110 [sqlippool] IP address could not be allocated as no pool exists with that name. ++[sqlippool] returns noop ++[exec] returns noop Any help please? What am I missing? Thanks a lot in advanced. Best regards, []'s --
On Oct 27, 2015, at 1:48 PM, Rod Elias <falajhou@gmail.com> wrote
Could someone please help me with a problem regarding freeradius sqlippool module?
I'm migrating to FreeRADIUS Version 2.1.10
Upgrade to 2.2.9. There is no reason to be running a version of the server which is 5+ years old.
For some reason, I noticed the %{control:Pool-Name} section in the SQL query isn't being resolved and, because that, SQL query doesn't return any results.
You cause just use %{Pool-Name} Alan DeKok.
Hi again. Thanks a lot for your help, Alan. I've change sqlippool.conf and also sql/mysql/ippool.conf to use {%Pool-Name} instead of %{control:Pool-Name}. Unfortunately, the same kind of problem still happens: +- entering group post-auth {...} rlm_sql (sql): Reserving sql socket id: 97 [sqlippool] expand: %{User-Name} -> maiza [sqlippool] sql_set_user escaped user --> 'maiza' [sqlippool] expand: START TRANSACTION -> START TRANSACTION [sqlippool] expand: UPDATE radippool SET nasipaddress = '', pool_key = 0, callingstationid = '', username = '', expiry_time = NULL WHERE expiry_time <= NOW() - INTERVAL 1 SECOND AND nasipaddress = '%{Nas-IP-Address}' -> UPDATE radippool SET nasipaddress = '', pool_key = 0, callingstationid = '', username = '', expiry_time = NULL WHERE expiry_time <= NOW() - INTERVAL 1 SECOND AND nasipaddress = '187.44.64.58' [sqlippool] expand: SELECT framedipaddress FROM radippool WHERE pool_name = '%{Pool-Name}' AND (expiry_time < NOW() OR expiry_time IS NULL) ORDER BY (username <> '%{User-Name}'), (callingstationid <> '%{Calling-Station-Id}'), expiry_time LIMIT 1 FOR UPDATE -> SELECT framedipaddress FROM radippool WHERE pool_name = '' AND (expiry_time < NOW() OR expiry_time IS NULL) ORDER BY (username <> 'maiza'), (callingstationid <> '00:0C:43:AC:76:C9'), expiry_time LIMIT 1 FOR UPDATE [sqlippool] SQL query did not return any results [sqlippool] expand: COMMIT -> COMMIT [sqlippool] expand: SELECT id FROM radippool WHERE pool_name='%{Pool-Name}' LIMIT 1 -> SELECT id FROM radippool WHERE pool_name='' LIMIT 1 [sqlippool] SQL query did not return any results rlm_sql (sql): Released sql socket id: 97 [sqlippool] IP address could not be allocated as no pool exists with that name. ++[sqlippool] returns noop Any other idea, please? Thank you very much! 2015-10-27 15:53 GMT-02:00 Alan DeKok <aland@deployingradius.com>:
On Oct 27, 2015, at 1:48 PM, Rod Elias <falajhou@gmail.com> wrote
Could someone please help me with a problem regarding freeradius sqlippool module?
I'm migrating to FreeRADIUS Version 2.1.10
Upgrade to 2.2.9. There is no reason to be running a version of the server which is 5+ years old.
For some reason, I noticed the %{control:Pool-Name} section in the SQL query isn't being resolved and, because that, SQL query doesn't return any results.
You cause just use %{Pool-Name}
Alan DeKok.
- List info/subscribe/unsubscribe? See http://www.freeradius.org/list/users.html
On Oct 27, 2015, at 2:28 PM, R. Elias <falajhou@gmail.com> wrote:
Unfortunately, the same kind of problem still happens:
From the look of it, there's no Pool-Name attribute. Please READ the debug output. It's there for a reason. Fix the configuration to set the Pool-Name attribute. It's not set right now, which is why the query is failing. And read ALL of the debug out. The server tells you what it's doing, and why. You need to do the work yourself to verify that it's doing what you expect it to do. Alan DeKok.
participants (3)
-
Alan DeKok -
R. Elias -
Rod Elias