I need some help trying to configure sqlippool.
 
I've followed the instruction from http://wiki.freeradius.org/Rlm_sqlippool and few other places.
 
I did compile FR from source with the following configuration options:
 
Options 1:
./configure --prefix=/usr/local/freeradius-server-2.1.1 --with-openssl --with-threads --with-vmps --with-modules=rlm_sqlippool
 
Options 2:
./configure --prefix=/usr/local/freeradius-server-2.1.1 --with-openssl --with-threads --with-vmps --with-rlm_sqlippool
 
Options 3:
./configure --prefix=/usr/local/freeradius-server-2.1.1 --with-openssl --with-threads --with-vmps --enable-rlm_sqlippool
 
Each time my start access point running hostapd, FR crashes with the following message.
 
 
 
 
Sun Oct 26 22:10:49 2008 : Info: ++[sradutmp] returns ok
Sun Oct 26 22:10:49 2008 : Debug: rlm_sql (sql): Reserving sql socket id: 1
Sun Oct 26 22:10:49 2008 : Info: [sqlippool]  expand: %{User-Name} ->
Sun Oct 26 22:10:49 2008 : Info: [sqlippool] sql_set_user escaped user --> ''
Sun Oct 26 22:10:49 2008 : Info: [sqlippool]  expand: START TRANSACTION -> START TRANSACTION
radiusd: symbol lookup error: /usr/local/freeradius-server-2.1.1/lib/rlm_sqlippool-2.1.1.so: undefined symbol: rlm_sql_query
 
Below are my configuration
OS: Ubuntu (Kernel 2.6.24-21)
FR: 2.1.1
 
radiusd.conf
 
exec_prefix = ${prefix}
sysconfdir = ${prefix}/etc
localstatedir = ${prefix}/var
sbindir = ${exec_prefix}/sbin
logdir = ${localstatedir}/log/radius
raddbdir = ${sysconfdir}/raddb
radacctdir = ${logdir}/radacct
name = radiusd
confdir = ${raddbdir}
run_dir = ${localstatedir}/run/radiusd
db_dir = ${raddbdir}
libdir = ${exec_prefix}/lib
pidfile = ${run_dir}/${name}.pid
max_request_time = 30
cleanup_delay = 5
max_requests = 1024
listen {
        type = auth
        ipaddr = *
        port = 0
}
listen {
        ipaddr = *
        port = 0
        type = acct
}
hostname_lookups = no
allow_core_dumps = no
regular_expressions     = yes
extended_expressions    = yes
log {
        destination = files
        file = ${logdir}/radius.log
        syslog_facility = daemon
        stripped_names = no
        auth = no
        auth_badpass = no
        auth_goodpass = no
}
checkrad = ${sbindir}/checkrad
security {
        max_attributes = 200
        reject_delay = 1
        status_server = yes
}
proxy_requests  = yes
$INCLUDE proxy.conf
$INCLUDE clients.conf
 
thread pool {
        start_servers = 5
        max_servers = 32
        min_spare_servers = 3
        max_spare_servers = 10
        max_requests_per_server = 0
}
modules {
        $INCLUDE ${confdir}/modules/
        $INCLUDE eap.conf
        $INCLUDE sql.conf
        $INCLUDE sql/mysql/counter.conf
        $INCLUDE sqlippool.conf
}
instantiate {
        exec
        expr
        daily
        expiration
        logintime
}
$INCLUDE policy.conf
$INCLUDE sites-enabled/
 
 
 
sites-enabled/default
 
authorize {
        preprocess
        chap
        mschap
        suffix
        eap {
                ok = return
        }
        unix
        #files
        sql
        daily
        expiration
        logintime
        pap
}
authenticate {
        Auth-Type PAP {
                pap
        }
        Auth-Type CHAP {
                chap
        }
        Auth-Type MS-CHAP {
                mschap
        }
        unix
        eap
}
preacct {
        preprocess
        acct_unique
        suffix
        #files
}
accounting {
        detail
        daily
        unix
        radutmp
        sradutmp
        sqlippool
        sql
        sql_log
        attr_filter.accounting_response
}
session {
        radutmp
}
post-auth {
        sqlippool
        reply_log
        sql
        sql_log
        exec
        Post-Auth-Type REJECT {
                attr_filter.access_reject
        }
}
pre-proxy {
}
post-proxy {
        eap
}
 
 
 
ippool.conf
 
 allocate-clear = "UPDATE ${ippool_table} \
  SET nasipaddress = '', pool_key = 0, \
  callingstationid = '', username = '', \
  expiry_time IS NULL \
  WHERE expiry_time <= NOW() - INTERVAL 1 SECOND
  AND nasipaddress = '%{Nas-IP-Address}'"
 
allocate-find = "SELECT framedipaddress FROM ${ippool_table} \
 WHERE pool_name = '%{control:Pool-Name}' AND expiry_time < NOW() \
 ORDER BY (username <> '%{User-Name}'), \
 (callingstationid <> '%{Calling-Station-Id}'), \
 expiry_time \
 LIMIT 1 \
 FOR UPDATE"
 
pool-check = "SELECT id FROM ${ippool_table} \
 WHERE pool_name='%{control:Pool-Name}' LIMIT 1"
allocate-update = "UPDATE ${ippool_table} \
 SET nasipaddress = '%{NAS-IP-Address}', pool_key = '${pool-key}', \
 callingstationid = '%{Calling-Station-Id}', username = '%{User-Name}', \
 expiry_time = NOW() + INTERVAL ${lease-duration} SECOND \
 WHERE framedipaddress = '%I'"
start-update = "UPDATE ${ippool_table} \
 SET expiry_time = NOW() + INTERVAL ${lease-duration} SECOND \
 WHERE nasipaddress = '%{NAS-IP-Address}' AND  pool_key = '${pool-key}'"
 
stop-clear = "UPDATE ${ippool_table} \
 SET nasipaddress = '', pool_key = 0, callingstationid = '', username = '', \
 expiry_time IS NULL \
 WHERE nasipaddress = '%{Nas-IP-Address}' AND pool_key = '${pool-key}' \
 AND username = '%{User-Name}' \
 AND callingstationid = '%{Calling-Station-Id}' \
 AND framedipaddress = '%{Framed-IP-Address}'"
 
alive-update = "UPDATE ${ippool_table} \
 SET expiry_time = NOW() + INTERVAL ${lease-duration} SECOND \
 WHERE nasipaddress = '%{Nas-IP-Address}' AND pool_key = '${pool-key}' \
 AND username = '%{User-Name}' \
 AND callingstationid = '%{Calling-Station-Id}' \
 AND framedipaddress = '%{Framed-IP-Address}'"
 
on-clear = "UPDATE ${ippool_table} \
 SET nasipaddress = '', pool_key = 0, callingstationid = '', username = '', \
 expiry_time IS NULL \
 WHERE nasipaddress = '%{Nas-IP-Address}'"
 
off-clear = "UPDATE ${ippool_table} \
 SET nasipaddress = '', pool_key = 0, callingstationid = '', username = '', \
 expiry_time IS NULL \
 WHERE nasipaddress = '%{Nas-IP-Address}'"
 
sqlippool.conf
 
sqlippool {
 
 sql-instance-name = "sql"
 ippool_table = "radippool"
 lease-duration = 3600
 pool-key = "%{NAS-Port}"
 #pool-key = "%{Calling-Station-Id}"
 $INCLUDE sql/mysql/ippool.conf
 
 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})"
 
}
radippool table
 
 
mysql> select * from radippool;
 
+----+-----------+-----------------+--------------+---------------------------+------------------+-------------+----------+----------+-----------------+-------------+----------+----------+
 
| id | pool_name | framedipaddress | nasipaddress | calledstationid           | callingstationid | expiry_time | username | pool_key |
 
+----+-----------+-----------------+--------------+---------------------------+------------------+-------------+----------+----------+-----------------+-------------+----------+----------+
 
|  2 | main_pool | 10.5.5.29       | 192.168.2.31 | 06-07-6F-4A-C1-60:Tlink-g |                        | NULL        | testuser      |                  |
 
|  3 | main_pool | 10.5.5.30       | 192.168.2.31 | 06-07-6F-4A-C1-60:Tlink-g |                        | NULL        | testuser2    |                  |
   
+----+-----------+-----------------+--------------+---------------------------+------------------+-------------+----------+----------+-----------------+-------------+----------+----------+
 
2 rows in set (0.00 sec)