Server Fault is a question and answer site for system and network administrators. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

The short version of my question is how do I limit individual user sessions to 24 hours, even if each session has the same UserName.

I have a radius server setup with CoovaChilli to authenticate wireless users to access the network. All the users have to do is agree to a "Terms of Service", so I have one user account which is free for everybody:

| 22 | freeuser | Simultaneous-Use | := | 99 | | 21 | freeuser | User-Password | := | freepass |

I would like to limit each individual user's session to 24 hours. But the Max-All-Session counter is:

query = "SELECT SUM(AcctSessionTime) \ FROM radacct WHERE UserName='%{%k}'"

So if I specify a Max-All-Session, then each free user's login time will count towards that 24 hour limit, and every session will expire too soon. Is it possible to use two keys for that sql counter so I can check the UserName and the CalledStationId? That should let me limit the individual session time by MAC address as well as user name.

Or is there a different/better way I should be trying to approach this problem? Thanks!

share|improve this question

Simply change the Key in the definition to :


and change the query to :

SELECT SUM(AcctSessionTime) \ FROM radacct WHERE calledstationid='%{%k}

there is a problem with this query though, in that the first time a user connects they will be granted no timeout ,as that query will return NULL , not 0

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.