Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

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
add comment

1 Answer

Simply change the Key in the definition to :

called-station-id

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
add comment

Your Answer

 
discard

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.