User disconnect

yzy-oui-fi yzy-oui-fi at hotmail.fr
Thu Jun 20 12:54:52 CEST 2013


Here is some more informations about how we solve this issue for people
who use dd-wrt as chillispot hotspot (like you Dagia):
______________________________________________________________________________________________________________
So first you should check that your router support or special firmware
(dd-wrt firmware base+ Ead-Ard powertools)

here is the database url: 

https://www.yzy-oui-fi.com/newhome/device_db.php


then you should register the router loaded with the firmware in our
Ead-Ard server(keep cool it is free of any charge! :) )

here is the url to register your device:

https://www.yzy-oui-fi.com/addnewdev.php?lang=en

there is also a wiki that explain how it works with our captive portal,
this will be a little bit different than yours, but this will give you a
good idea of the ead-ard system.

http://wiki.yzy-oui-fi.com/dashboard/wiki/index.php/DD-WRT_Firmware_Wisp_E3dition


And now....here is the server side:

1°) you should create a subdirectory to your web directory called
wifi-1.1.1
2°) you should create a mysql table in your freeradius database called
heartbeat
----------------
CREATE TABLE `heartbeat` (
  `mac` varchar(20) NOT NULL default '',
  `hostname` varchar(128) default NULL,
  `ssid` varchar(32) default NULL,
  `wanip` varchar(16) default NULL,
  `realip` varchar(16) default NULL,
  `thetime` datetime default NULL,
  `ext` varchar(255) default NULL,
  `notes` longtext,
  `nasid` varchar(255) default NULL,
  `om` varchar(1) NOT NULL default '1',
  PRIMARY KEY  (`mac`),
  UNIQUE KEY `hbind1` (`realip`,`mac`)
) ENGINE=MyISAM DEFAULT CHARSET=latin1;
----------------


3°) in the wifi-1.1.1 directory place the heartbeat.php (see zip file
this file is based on wifigator kind of heartbeat, if you run freeradius
2 or higher you probably have to make some change in db table and field
name)
4°) modify its mysql connection to your information

So if everything is ok every 15 minute your router should send its
online  status to the freeradius server(assumption your freeradius
server also run a php webserver and mysql is used to run freeradius).

Now you need a cron job ran on server side that will check if a router
is considered as down querying heartbeat table and compare last status
with the current time and act in radacct table to close opened
session....

5°)here is the user session closing script 

you will need to run the following from cron job

"wget http://yourdomain/yourdirectory/checksession2close.php"

you could set the cron loop to 5 minutes , less  is not recommanded.

So here you are, with all this and with some mods, your session should
closed at least 20 minutes after your device went down

______________________________________________________________________________________________________________

Le jeudi 20 juin 2013 à 09:02 +0200, yzy-oui-fi a écrit :

> I guess you will need an external client/server status script  (this
> is what we have done with our captiv portal server). the router send
> its status within a loop to the freeradius server, and the server will
> check the status sent avairage, if avairage exceed defined loop, then
> we  close every attached user account session. 
> 
> Le mercredi 19 juin 2013 à 23:21 -0700, Dagia Dorjsuren a écrit : 
> 
> > Hello,
> > 
> >     Does anyone know how to solve following issue? 
> > 
> > In this case :
> > 
> > 1. NAS (Chillispot based access point)
> > 2. Freeradius
> > 
> > If NAS is shutdowned, the freeradius keeps all user logins of that
> > NAS. In this case, the users session is alive. In fact, freeradius
> > doesn't know if NAS's status is shutdowned or running. Is there any
> > configuration that freeradius disconnects the users automatically
> > when NAS is shutdowned? On the other hand, I would like to terminate
> > the user's session when NAS is shutdowned or unavailable.
> > 
> > 
> > 
> > -
> > List info/subscribe/unsubscribe? See http://www.freeradius.org/list/users.html
> 
> 
> 
> -
> 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/20130620/5948c738/attachment.html>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: checksession2close.php.zip
Type: application/zip
Size: 797 bytes
Desc: not available
URL: <http://lists.freeradius.org/pipermail/freeradius-users/attachments/20130620/5948c738/attachment.zip>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: heartbeat.php.zip
Type: application/zip
Size: 1435 bytes
Desc: not available
URL: <http://lists.freeradius.org/pipermail/freeradius-users/attachments/20130620/5948c738/attachment-0001.zip>


More information about the Freeradius-Users mailing list