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.
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
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_E3d... 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
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;
Why are you telling users to cripple their database by using MyISAM? They should be using InnoDB, though honestly SQLite would be quite sufficient for something this simple.
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
Or you can do what I said, which is simpler and doesn't add another dependency.
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
No, this is ridiculously over complicated, if your NAS supports interim updates just do it how I said. -Arran Arran Cudbard-Bell <a.cudbardb@freeradius.org> FreeRADIUS Development Team
this is a sample if you prefer innodb or what ever...No probleme. Le jeudi 20 juin 2013 à 12:30 +0100, Arran Cudbard-Bell a écrit :
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;
Why are you telling users to cripple their database by using MyISAM? They should be using InnoDB, though honestly SQLite would be quite sufficient for something this simple.
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
Or you can do what I said, which is simpler and doesn't add another dependency.
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
No, this is ridiculously over complicated, if your NAS supports interim updates just do it how I said.
DD-WRT do not support it untill now(interim updates) unfortunatly.... over complicated maybe, but in our case we implement our webui to use this in order to also inject command line in remote routers and manage it if required.
-Arran
Arran Cudbard-Bell <a.cudbardb@freeradius.org> FreeRADIUS Development Team
- List info/subscribe/unsubscribe? See http://www.freeradius.org/list/users.html
On 20 Jun 2013, at 15:49, yzy-oui-fi <yzy-oui-fi@hotmail.fr> wrote:
this is a sample if you prefer innodb or what ever...No probleme.
Yes, and people who don't know better follow sample configurations posted to mailing lists. It's not a case of preferring, it's the fact that MyISAM does table level locking on update. It is the WRONG engine to use for tables which require regular updates. Arran Cudbard-Bell <a.cudbardb@freeradius.org> FreeRADIUS Development Team
Le jeudi 20 juin 2013 à 16:06 +0100, Arran Cudbard-Bell a écrit :
On 20 Jun 2013, at 15:49, yzy-oui-fi <yzy-oui-fi@hotmail.fr> wrote:
this is a sample if you prefer innodb or what ever...No probleme.
Yes, and people who don't know better follow sample configurations posted to mailing lists.
It's not a case of preferring, it's the fact that MyISAM does table level locking on update. It is the WRONG engine to use for tables which require regular updates.
Sure but if you have 100 devices(this is already a big chillispot network) and they all update during 15 minutes it gives an update query each 9 secondes(avairage)...I guess it is far from real time update ... Anyway , you are right it is not a case of prefering, but a sort of advanced scratch( as i provide the stable client side)...;)
Arran Cudbard-Bell <a.cudbardb@freeradius.org> FreeRADIUS Development Team
- List info/subscribe/unsubscribe? See http://www.freeradius.org/list/users.html
Hi,
) ENGINE=MyISAM DEFAULT CHARSET=latin1;
urgh. i'll have to agree with others here.... MyISAM should have died many years ago..its a plague on any bust MySQL box. use at least InnoDB - which is supported by MySQL natively for many a year..... and before any complaints about users who can only follow instructions on web page or such there are PLENTY of basic guides and basic my.cnf examples for pretty decent InnoDB configurations (and there are plenty of automagic MySQL optimisation checker scripts that can tune those value to be optimal for the system (CPU/thread/memory/caching etc) however, interesting/useful tool for those that need it. alan
On 20.06.2013 08:21, Dagia Dorjsuren wrote:
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?
Freeradius can't disconnect a user, except by sending CoA Packets to the NAS. But in your case, the NAS is down. I guess you're keeping the accounting information in a database or something. You need to run an expiration query so the session is marked closed when freeradius doesn't hear from the NAS for a certain amount of time. Search through the list as this came up a few weeks ago. Olivier -- Olivier Beytrison Network & Security Engineer, HES-SO Fribourg Mail: olivier@heliosnet.org
On 20 Jun 2013, at 08:15, Olivier Beytrison <olivier@heliosnet.org> wrote:
On 20.06.2013 08:21, Dagia Dorjsuren wrote:
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?
Freeradius can't disconnect a user, except by sending CoA Packets to the NAS. But in your case, the NAS is down.
I guess you're keeping the accounting information in a database or something. You need to run an expiration query so the session is marked closed when freeradius doesn't hear from the NAS for a certain amount of time.
The schema/scripts in 3.0 have been modified to record this. You should be able to run multiple update statements on receiving a stop, so the database is self maintaining without an external script. Arran Cudbard-Bell <a.cudbardb@freeradius.org> FreeRADIUS Development Team
participants (5)
-
A.L.M.Buxey@lboro.ac.uk -
Arran Cudbard-Bell -
Dagia Dorjsuren -
Olivier Beytrison -
yzy-oui-fi