User disconnects but stays online in radius

Phil Mayers p.mayers at
Mon Feb 18 19:20:10 CET 2013

On 18/02/13 18:02, Mobin Yazarlou wrote:
> Hi,
>   I am using freeradius v2.1.12 with MySQL support and noticed if a user
> disconnect when radius server is down, NAS can not inform radius about
> user being disconnected and radius assume user is still online after
> coming up again. This restricts user from connecting again when you set
> simultaneous-use to 1.
>   Is there any solution for this? My NAS is pptpd on Debian 6.

RADIUS uses UDP, and NASes don't "save" accounting packets which don't 
get a reply; they usually send 1-5 attempts over a few seconds, then 
give up (or move to the 2nd RADIUS server).

You need to take this into account.

Possible solutions include some combination of:

  1. Use interim accounting. Then, use a script to expire any sessions 
which have not seen accounting packets in X*interim-interval; X==3 for 

  2. Setup a 2nd RADIUS accounting server and ensure your NAS has both 
servers configured. Use one of several configs to write the accounting 
data to a robust, replicated database. One way to do this is with the 
"robust" accounting that comes with FreeRADIUS.

  3. Use a script to check your NASes active sessions and compare to 
accounting data at a certain interval.

...and so on.

More information about the Freeradius-Users mailing list