pihomeserver / Kupiki-Hotspot-Script

Create automatically a full Wifi Hotspot on Raspberry Pi including a Captive Portal
Other
300 stars 119 forks source link

prepaid user setup #19

Closed reigelgallarde closed 7 years ago

reigelgallarde commented 7 years ago

hello, thank you for the script, it's working.

I have a question though, how to setup/create a user with 1 hour limit?

pihomeserver commented 7 years ago

Hello

Please look at Daloradius functions. An exemple of configuration that seems to work : https://ubuntuforums.org/showthread.php?t=2070298&highlight=daloradius

You have to create counters that will consolidate the time and volume of a connected user (section FreeRadius SQL counter.conf settings needed)

Then you create profiles linked to the counters and apply to the user (section daloRADIUS 0.9-9 – QUCIK START)

Hope it helps

reigelgallarde commented 7 years ago

ok, thanks... I will try this...

I hope you can add this also on the script... would be very useful for everyone...

pihomeserver commented 7 years ago

Yes that's a good idea. At least I can add the counters creation.

reigelgallarde commented 7 years ago

I was not able to make it work on my first try. Haha. Just not my thing. I hope you can update the script and add this kind of functionality.

I will however try again until it works. 😄

pihomeserver commented 7 years ago

Yesterday I updated configuration files. Hope that today I will be able to create attributes in daloradius and test them

reigelgallarde commented 7 years ago

great! wish you good luck!

reigelgallarde commented 7 years ago

hello, have you got any luck on this one?

anyway, I have tested your new script on a fresh install of minibian, and I think it got some error... freeradius is not running... I tried calling service freeradius start and it won't start... searching at Google I found and tried to call freeraduis -X freeradius will still not run... something with ports being used chilli.

I then remove coa like rm /etc/freeradius/sites-enabled/coa do a reboot, then all starts working... not sure what's wrong.

pihomeserver commented 7 years ago

Updated. The Coova CoA port was in conflict with the freeradius support that is not required.

The new script activates defaults SQL counters. Look here for implementation : https://wiki.freeradius.org/modules/Rlm_sqlcounter

Please tell me if it works

reigelgallarde commented 7 years ago

yes, this one works... I tried it earlier... using mysql commands....

what's not working is daloradius... it seems daloradius does not have the correct sql command... I'm not sure...

pihomeserver commented 7 years ago

Ok if both of us can investiguate we should be able to find a way. I will put on side the Squid integration for now to come back on this point

pihomeserver commented 7 years ago
capture d ecran 2017-03-09 a 19 14 12

Checked daloradius and the radcheck table content and the attribute is well created but not taken into account to disconnect the user

capture d ecran 2017-03-09 a 19 12 39
pihomeserver commented 7 years ago

In progress : 1) Edit /etc/freeradius/sites-enabled/default and uncomment line 192 to authorize daily counter 2) Restart freeradius 3) In daloradius add one attribute using the daloradius dictionary

capture d ecran 2017-03-10 a 22 07 15

4) Use a sql tool to inject in the table radreply an attribute that will be sent to coova when the limit is reached. I was not able to add it using daloradius

capture d ecran 2017-03-10 a 22 39 13

Now i can only use my account for 30 seconds and no more. The interface is really bad as it says that i'm able to log in but looking at session information i see that the user is immediately kicked off

capture d ecran 2017-03-10 a 22 42 19