FreeRadius reset counter
-
Please, I want to ask if the FreeRadius reset counter for accounting-stop or interim-updates for bandwidth allocation in Captive Portal is fixed or if I still need a cron to do that.
I also want to know if it's possible to use both Time Configuration and Traffic and Bandwidth In FreeRadius for Captive Portal.
Thanks
-
Install the pfSEnse cron package. You'll see the daily, weekly and monthly scripts that empty the 'counter' (files).
You can even look at the scripts, and see what and how they do it.
Or even create your own scripts;@stephenkwabena said in FreeRadius reset counter:
both Time Configuration and Traffic and Bandwidth In FreeRadius for Captive Portal.
Bandwidth control works fine, and is not time based.
Time configuration : users can login when allowed - Not sure if they are also auto logged out when the time frame expires. -
@gertjan Thank you very much for your reply. One more thing I noticed, I set up Captive Portal with FreeRadius Mac authentication with bandwidth allocation which works fine.
The moment pfsense server reboot or goes off, the bandwidth allocation or counter reset again e.g FreeRADIUS: User 64-27-37-fb-f9-6f has used 0 MB of 5120 instead of continuing from FreeRADIUS: User 64-27-37-fb-f9-6f has used 701 MB of 5120
Please is it something I'm not doing rigth??
Thank you -
This :
is a line that you will see a lot. To much for me, so, I open the script file,
/usr/local/etc/raddb/scripts/datacounter_auth.shand add a "##" in front of line 20 :
## logger -f /var/log/system.log "FreeRADIUS: User $USERNAME has used $USEDOCTETSUSERNAMEMB MB of $MAXOCTETSUSERNAMEMB MB $TIMERANGE allotted traffic. The login request was accepted."
because I don't want this line "some user has used xx of his total YYYY volume' to be spammed every couple of minutes. It renders my main system log file completely useless and that is not ok for me.
The other condition : when a user has used up all his bytes, that event is logged.Btw : the files that store the "bytes used" info : read the script file again, is in /var/log/....
and everything in /var/ should be considered volatile, so it does not persist after a reboot.
If you use a ram disk as /var/ space, this will be 100 true.But, good news : I'm not sure if on my pfSense the info is reset, as I can't test it right now. I rarely reboot pfSense. It stays up for weeks if not months.
-
@gertjan Okay...but I want to see real-time and also I don't know why the counter resets itself.
"But, good news: I'm not sure if on my pfSense the info is reset, as I can't test it right now. I rarely reboot pfSense. It stays up for weeks if not months" Yes but I experience a lot of light out here. -
@stephenkwabena said in FreeRadius reset counter:
experience a lot of light out here.
No system what so ever handles power outages well.
That is, your coffee machine or the light bulbs do, as they don't have a file system.
remove the power from your PC, or phone (that's why batteries are not removable any more) or even your car : you will have issue.
pfSense is the same.If you have power issues permit the device to shut down properly by using a small UPS.
Btw : I just rebooted pfSense.
I took a copy of all the FreeRadius "counter files", and rebooted.
The logged in users where still logged in, and the counter files were not reset or wiped.
So maybe your issue is related to power outages, that breaks the files system, and upon repair during reboot the info is lost.
Yet the same reason to use an UPS or use a more stable power source. -
@gertjan Okay. this is another screenshot without power being off or reboot
You notice it was 6184 MB and it went back to 6 MB