&>nbsp;

This module is sligthly different than last module; The significant difference is in the query attribute where the sql query will calculate the time used by a user from the first access time of a user.
It will compare to Access-Period we define, and terminate a user session when the times expire.

Using this, we can limit a user access period for 1 day or 1 week from his first time he login using the a prepaid card.
The counter module we create is as below,

— snipped —
sqlcounter accessperiod {

counter-name = Max-Access-Period-Time
check-name = Access-Period
sqlmod-inst = sql
key = User-Name
reset = never
query = “SELECT UNIX_TIMESTAMP() – UNIX_TIMESTAMP(AcctStartTime) FROM radacct WHERE UserName = ‘%{%k}’ ORDER BY AcctStartTime LIMIT 1?

— snipped —

In the authorize section, we should include the module:

— snipped —
authorize {

 

preprocess
chap
mschap
suffix
eap
files
sql
pap
accessperiod

}
— snipped —

And as usual, we need to restart/reload the server to make the new configuration take effect.

Then for the radcheck table, we insert the appropriate attribute:

+—-+—–———–+———————+—-+————-+
| id   | UserName  | Attribute           | op | Value     |
+—-+——–——–+———————+—-+————-+
| 3    | user             | Access-Period   | := | 3600     |
+—-+——–——–+———–———-+—-+————-+

Incoming search terms for the article:

freeradius expiration attribute (28), RADIUS_USERMAX (24), freeradius Access-Period (21), freeradius expiration sql (13), daloRADIUS CoovaChilli (12), freeradius traffic counter (12), daloradius Expiration (11), Max-Access-Period-Time (10), freeradius access period (10), daloradius time limit (9), mikrotik daloradius (7), freeradius counter (6), freeradius2 expiration (5), phpmyprepaid activate date (5), coovachilli counter sql ? (4), freeradius sqlcounter (4), freeradius time range (4), coovachilli daloradius (3), freeradius wordpress (3), radius Access-Period (3)

Filed: Internet Networking
tags: , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , ,
previous post :
Next post :
HomeInternet NetworkingFreeradius Limit User Access by Period Started from Activation Time