Accept a number of MAC address per login
Hello, I would like to authorize a user to connect to the freeradius server with a maximum of 3 PC. I added a counter, an attribute for the check-name and a line in radcheck table but for my counter I'd like a query like this : select (COUNT(distinct CallingStationId)) FROM radcheck WHERE UserName='user_login' AND CallingStationId !='MAC_client' But there is I think, only one key and I need two. How can I do it ? Thank for your help ! -- View this message in context: http://freeradius.1045715.n5.nabble.com/Accept-a-number-of-MAC-address-per-l... Sent from the FreeRadius - User mailing list archive at Nabble.com.
I solved the problem : /etc/freeradius/sites-enabled/default authorize{ ... if("%sql:SELECT COUNT(DISTINCT CallingStationId) FROM radacct WHERE UserName='%{User-Name}' AND CallingStationId != '%{Calling-Station-Id}'}"<"%{sql:SELECT Value FROM radcheck WHERE Attribute = 'Max-User-Machine' AND UserName='%{User-Name}'}"){ ok update control{ Auth-Type := Accept } else{ update reply{ Reply-Message := "Too much MAC for this user" } reject } ... } -- View this message in context: http://freeradius.1045715.n5.nabble.com/Accept-a-number-of-MAC-address-per-l... Sent from the FreeRadius - User mailing list archive at Nabble.com.
Thanks! El vie, 05-08-2011 a las 03:42 -0700, ShR3K escribió:
I solved the problem : /etc/freeradius/sites-enabled/default
authorize{ ... if("%sql:SELECT COUNT(DISTINCT CallingStationId) FROM radacct WHERE UserName='%{User-Name}' AND CallingStationId != '%{Calling-Station-Id}'}"<"%{sql:SELECT Value FROM radcheck WHERE Attribute = 'Max-User-Machine' AND UserName='%{User-Name}'}"){ ok update control{ Auth-Type := Accept } else{ update reply{ Reply-Message := "Too much MAC for this user" } reject }
... }
-- View this message in context: http://freeradius.1045715.n5.nabble.com/Accept-a-number-of-MAC-address-per-l... Sent from the FreeRadius - User mailing list archive at Nabble.com. - List info/subscribe/unsubscribe? See http://www.freeradius.org/list/users.html
participants (2)
-
aceror -
ShR3K