Patch for raddb/sql/mysql/ippool.conf

Peter Nixon listuser at peternixon.net
Fri Aug 7 08:58:21 CEST 2009


Hi Chris

I have a deployment very similar to yours. I specifically use the IMSI as the 
pool key only in order to always give the same IP to the phone, and solve the 
disconnect/reconnect/timeout issue with a Packet-of-Disconnect sent to the 
GGSN for the old session during the authorization stage for the new session..

Regards

Peter

On Fri 31 Jul 2009, Chris Moules wrote:
> Sorry this is not a GIT patch.
>
> Here are two minor fixes to the MySQL ippool.conf file.
>
> 1) A Syntax correction for the alternative 'allocate-find' query.
>
> 2) There was an issue with the 'start-update' query updating more than it
> should. I am using IMSI codes as my pool-key. In the case that a phone
> disconnects, but no Acct-Stop is received the expiry_time is updated every
> time that this phone reconnects as only the NAS and the pool-key are used
> as update limiters.
>
> By including at least the framedipaddress this is solved.
>
> As both the 'stop-clear' and 'alive-update' sections are using the 3
> additional qualifiers, it makes sense to use them here too. (I see no
> reason no to).
>
> Regards
>
> Chris
>
> --- ippool.conf.orig    2009-07-31 15:16:38.000000000 +0200
> +++ ippool.conf 2009-07-31 15:17:57.000000000 +0200
> @@ -39,7 +39,7 @@
>   # ## use this query instead
>   # allocate-find = "SELECT framedipaddress FROM ${ippool_table} \
>   #  WHERE pool_name = '%{control:Pool-Name}' \
> -#  AND expiry_time = NULL \
> +#  AND expiry_time IS NULL \
>   #  ORDER BY RAND() \
>   #  LIMIT 1 \
>   #  FOR UPDATE"
> @@ -67,7 +67,10 @@
>   ## START record arrives
>   start-update = "UPDATE ${ippool_table} \
>    SET expiry_time = NOW() + INTERVAL ${lease-duration} SECOND \
> - WHERE nasipaddress = '%{NAS-IP-Address}' AND  pool_key = '${pool-key}'"
> + WHERE nasipaddress = '%{NAS-IP-Address}' AND  pool_key = '${pool-key}' \
> + AND username = '%{User-Name}' \
> + AND callingstationid = '%{Calling-Station-Id}' \
> + AND framedipaddress = '%{Framed-IP-Address}'"
>
>   ## This series of queries frees an IP number when an accounting
>   ## STOP record arrives
> -
> List info/subscribe/unsubscribe? See
> http://www.freeradius.org/list/devel.html


-- 
Peter Nixon
IT & Systems Engineering Manager
AirTies Wireless Networks
tel :+90 212 318 6200
http://www.airties.com

Don't worry about people stealing an idea. If it's original, you will have to 
ram it down their throats - Howard Aiken



More information about the Freeradius-Devel mailing list