permit access on date/hour intervals and policy.conf problem

Alan DeKok aland at deployingradius.com
Tue May 19 19:20:12 CEST 2015


On May 19, 2015, at 12:49 PM, Franz Angeli <franz.angeli at gmail.com> wrote:
> I need to be able to specify an interval of date and time for
> accessing through a captive portal connected to freeradius;
> 
> for example testuser can use network from 2015-05-01 17:00:00 to
> 2015-05-01 18:00:00
> 
> i create 3 custom attributes:
> 
> ATTRIBUTE System-Date 3002 integer
> ATTRIBUTE Start_Time 3000 integer
> ATTRIBUTE Stop_Time 3001 integer

  These should probably be of type "date", and not "integer".  But it won't make a huge amount of difference.

> System-Date to store system data
> 
> Start_Time to assign a start auth period for user
> 
> Stop_Time to assign the end of auithentication permission.

  That's fine.

> for provisioning purpose i use Freeradius + MySQL and in my radcheck
> table i have for example:
> 
> testuser | Cleartext-Password | := | testuser
> testuser | Start_Time         | := | 1430499600
> testuser | Stop_Time          | := | 1430503200

  That should work.

> to check account validity i add on policy.conf :

  That should work, too.

> freeradius start without error, System-Date take the correct value for
> Date but Start_Time and Stop_Time in this way seems to work with a
> file not mysql...(yes my default site has check_validity in authorize
> section)

  That's good.

> I don't know how use a query to assign database stored value for
> Start_Time and Stop_TIme, is it possbile? I need some examples...

  You are assigning the values from the database.  That's what the entries in the radcheck table do.

  Perhaps you could describe in more detail what you want.

  Alan DeKok.




More information about the Freeradius-Users mailing list