Pool-Name woes with sqlippool
Simon Earthrowl
searthrowl at eseye.com
Wed Feb 18 15:28:13 CET 2009
Hi Ivan,
Many thanks for your suggestion. However, (using 2.1.3) my
sqlippool.conf file is now:
sqlippool {
#########################################
## SQL instance to use (from sql.conf) ##
#########################################
sql-instance-name = "sql"
Pool-Name = %{control:Huntgroup-Name}
## SQL table to use for ippool range and lease info
ippool_table = "radippool"
## IP lease duration. (Leases expire even if Acct Stop packet is
lost)
lease-duration = 3600
## Attribute which should be considered unique per NAS
## Using NAS-Port gives behaviour similar to rlm_ippool. (And ACS)
## Using Calling-Station-Id works for NAS that send fixed NAS-Port
## ONLY change this if you know what you are doing!
# pool-key = "%{NAS-Port}"
pool-key = "%{Calling-Station-Id}-%{control:Huntgroup-Name}"
# "%{request:Huntgroup-Name}"
$INCLUDE sql/mysql/ippool.conf
## Logging configuration. (Comment out to disable logging)
sqlippool_log_exists = "Existing IP: %{reply:Framed-IP-Address}
(did %{Called-Station-Id} cli %{Calling-Station-Id} port %{NAS-Port}
user %{User-Name})"
sqlippool_log_success = "Allocated IP:
%{reply:Framed-IP-Address} from %{control:Pool-Name} (did
%{Called-Station-Id} cli %{Calling-Station-Id} port %{NAS-Port} user
%{User-Name})"
sqlippool_log_clear = "Released IP %{Framed-IP-Address} (did
%{Called-Station-Id} cli %{Calling-Station-Id} user %{User-Name})"
sqlippool_log_failed = "IP Allocation FAILED from
%{control:Pool-Name} (did %{Called-Station-Id} cli %{Calling-Station-Id}
port %{NAS-Port} user %{User-Name})"
sqlippool_log_nopool = "No Pool-Name defined (did
%{Called-Station-Id} cli %{Calling-Station-Id} port %{NAS-Port} user
%{User-Name} hunt %{Huntgroup-Name} pool %{Pool-Name})"
}
When running with debugging on, I get:
.....
Wed Feb 18 14:21:03 2009 : Debug: (Loaded rlm_sqlippool, checking if
it's valid)
Wed Feb 18 14:21:03 2009 : Debug: Module: Linked to module rlm_sqlippool
Wed Feb 18 14:21:03 2009 : Debug: Module: Instantiating sqlippool
Wed Feb 18 14:21:03 2009 : Debug: sqlippool {
Wed Feb 18 14:21:03 2009 : Debug: sql-instance-name = "sql"
Wed Feb 18 14:21:03 2009 : Debug: lease-duration = 3600
Wed Feb 18 14:21:03 2009 : Debug: pool-name =
"%{control:Huntgroup-Name}"
Wed Feb 18 14:21:03 2009 : Debug: allocate-begin = "START TRANSACTION"
Wed Feb 18 14:21:03 2009 : Debug: allocate-clear = "UPDATE
radippool SET expiry_time = NOW() WHERE callingstationid =
'%{Calling-Station-Id}' AND pool_name = '%{control:Pool-Name}'"
Wed Feb 18 14:21:03 2009 : Debug: allocate-find = "SELECT
framedipaddress FROM radippool WHERE pool_name = '%{control:Pool-Name}'
AND callingstationid = '%{Calling-Station-Id}' LIMIT 1 FOR UPDATE"
Wed Feb 18 14:21:03 2009 : Debug: allocate-update = "UPDATE
radippool SET nasipaddress = '%{NAS-IP-Address}', username =
'%{User-Name}' WHERE framedipaddress = '%I'"
Wed Feb 18 14:21:03 2009 : Debug: allocate-commit = "COMMIT"
Wed Feb 18 14:21:03 2009 : Debug: allocate-rollback = "ROLLBACK"
Wed Feb 18 14:21:03 2009 : Debug: pool-check = ""
Wed Feb 18 14:21:03 2009 : Debug: start-begin = "START TRANSACTION"
Wed Feb 18 14:21:03 2009 : Debug: start-update = "UPDATE radippool
SET expiry_time = NOW() + INTERVAL 3600 SECOND WHERE
nasipaddress = '%{NAS-IP-Address}' AND pool_key =
'%{Calling-Station-Id}-%{control:Huntgroup-Name}'"
Wed Feb 18 14:21:03 2009 : Debug: start-commit = "COMMIT"
Wed Feb 18 14:21:03 2009 : Debug: start-rollback = "ROLLBACK"
Wed Feb 18 14:21:03 2009 : Debug: alive-begin = "START TRANSACTION"
Wed Feb 18 14:21:03 2009 : Debug: alive-update = "UPDATE radippool
SET expiry_time = NOW() + INTERVAL 3600 SECOND WHERE
nasipaddress = '%{Nas-IP-Address}' AND pool_key =
'%{Calling-Station-Id}-%{control:Huntgroup-Name}' AND username =
'%{User-Name}' AND callingstationid = '%{Calling-Station-Id}' AND
framedipaddress = '%{Framed-IP-Address}'"
Wed Feb 18 14:21:03 2009 : Debug: alive-commit = "COMMIT"
Wed Feb 18 14:21:03 2009 : Debug: alive-rollback = "ROLLBACK"
Wed Feb 18 14:21:03 2009 : Debug: stop-begin = "START TRANSACTION"
Wed Feb 18 14:21:03 2009 : Debug: stop-clear = "UPDATE radippool
SET nasipaddress = '', pool_key = 0, callingstationid = '', username =
'', expiry_time IS NULL WHERE nasipaddress = '%{Nas-IP-Address}' AND
pool_key = '%{Calling-Station-Id}-%{control:Huntgroup-Name}' AND
username = '%{User-Name}' AND callingstationid =
'%{Calling-Station-Id}' AND framedipaddress = '%{Framed-IP-Address}'"
Wed Feb 18 14:21:03 2009 : Debug: stop-commit = "COMMIT"
Wed Feb 18 14:21:03 2009 : Debug: stop-rollback = "ROLLBACK"
Wed Feb 18 14:21:03 2009 : Debug: on-begin = "START TRANSACTION"
Wed Feb 18 14:21:03 2009 : Debug: on-clear = "UPDATE radippool SET
nasipaddress = '', pool_key = 0, callingstationid = '', username = '',
expiry_time IS NULL WHERE nasipaddress = '%{Nas-IP-Address}'"
Wed Feb 18 14:21:03 2009 : Debug: on-commit = "COMMIT"
Wed Feb 18 14:21:03 2009 : Debug: on-rollback = "ROLLBACK"
Wed Feb 18 14:21:03 2009 : Debug: off-begin = "START TRANSACTION"
Wed Feb 18 14:21:03 2009 : Debug: off-clear = "UPDATE radippool
SET nasipaddress = '', pool_key = 0, callingstationid = '', username =
'', expiry_time IS NULL WHERE nasipaddress = '%{Nas-IP-Address}'"
Wed Feb 18 14:21:03 2009 : Debug: off-commit = "COMMIT"
Wed Feb 18 14:21:03 2009 : Debug: off-rollback = "ROLLBACK"
Wed Feb 18 14:21:03 2009 : Debug: sqlippool_log_exists = "Existing
IP: %{reply:Framed-IP-Address} (did %{Called-Station-Id} cli
%{Calling-Station-Id} port %{NAS-Port} user %{User-Name})"
Wed Feb 18 14:21:03 2009 : Debug: sqlippool_log_success =
"Allocated IP: %{reply:Framed-IP-Address} from %{control:Pool-Name} (did
%{Called-Station-Id} cli %{Calling-Station-Id} port %{NAS-Port} user
%{User-Name})"
Wed Feb 18 14:21:03 2009 : Debug: sqlippool_log_clear = "Released
IP %{Framed-IP-Address} (did %{Called-Station-Id} cli
%{Calling-Station-Id} user %{User-Name})"
Wed Feb 18 14:21:03 2009 : Debug: sqlippool_log_failed = "IP
Allocation FAILED from %{control:Pool-Name} (did %{Called-Station-Id}
cli %{Calling-Station-Id} port %{NAS-Port} user %{User-Name})"
Wed Feb 18 14:21:03 2009 : Debug: sqlippool_log_nopool = "No
Pool-Name defined (did %{Called-Station-Id} cli %{Calling-Station-Id}
port %{NAS-Port} user %{User-Name} hunt %{Huntgroup-Name} pool
%{Pool-Name})"
Wed Feb 18 14:21:03 2009 : Debug: defaultpool = "main_pool"
Wed Feb 18 14:21:03 2009 : Debug: }
.....
Wed Feb 18 14:21:17 2009 : Auth: Login OK:
[searthrowl/Anything-you-like] (from client localhost port 12345 cli
447XXXXXXXX)
Wed Feb 18 14:21:17 2009 : Info: +- entering group post-auth {...}
Wed Feb 18 14:21:17 2009 : *Info: [sqlippool] No Pool-Name defined.*
Wed Feb 18 14:21:17 2009 : Info: [sqlippool] expand: No Pool-Name
defined (did %{Called-Station-Id} cli %{Calling-Station-Id} port
%{NAS-Port} user %{User-Name} hunt %{Huntgroup-Name} pool %{Pool-Name})
-> No Pool-Name defined (did domain.co.uk cli 447XXXXXXX port 12345 user
searthrowl hunt domain.co.ukA pool )
Wed Feb 18 14:21:17 2009 : Info: No Pool-Name defined (did domain.co.uk
cli 447XXXXXX port 12345 user searthrowl hunt domain.co.ukA pool )
Wed Feb 18 14:21:17 2009 : Info: ++[sqlippool] returns noop
Any thoughts?
Kind regards
Simon
tnt at kalik.net wrote:
>> What I would love to do is set up Huntgroups (OK so that bit works too!)
>> and then in the sqlippool.conf just assign pool-name = %{Huntgroup-Name}
>>
>> This doesn't work, and all I get is pool-name is undefined.
>>
>> Does anyone have any ideas?
>>
>>
>
> %{control:Huntgroup-Name}
>
> Ivan Kalik
> Kalik Informatika ISP
>
> -
> List info/subscribe/unsubscribe? See http://www.freeradius.org/list/users.html
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.freeradius.org/pipermail/freeradius-users/attachments/20090218/c450c6ec/attachment.html>
More information about the Freeradius-Users
mailing list