unlang dailycounter
Hello , i'm using FR 3.0.3 under debian7,mysql this is the situation: - a NAS with unlang rule (match a nas-ip-address) to get internet access 1 hour per day to computer wired pc - in the same building there are wireless hotspots that doesn't match the unlang rule and controlled by another NAS * both NASes managed by the same Freeradius server (radacct table) 1st: an user connects by wireless hotspot for 2 hrs 2nd: again the same user wants to get access by wired pc but is rejected (because has reached the limit per day) how i can give 1 hour internet access by wired independent if this user accesses after or before by wireless? this is the rule to wired NAS if (NAS-IP-Address == x.y.z.u) { update reply { Mikrotik-Rate-Limit := 1024k/2048k Port-Limit := 1 } update control { Max-Daily-Session := 3600 } } regards pablo umanzor
On May 6, 2015, at 7:22 PM, Pablo Umanzor <info@redlibre.cl> wrote:
- a NAS with unlang rule (match a nas-ip-address) to get internet access 1 hour per day to computer wired pc - in the same building there are wireless hotspots that doesn't match the unlang rule and controlled by another NAS
* both NASes managed by the same Freeradius server (radacct table)
That's the key. Because the counter module uses the radacct table to track the users time on the network. So putting accounting for *both* NASes into the same table will cause the counter module to count logins from both NASes. The solution is to look at the SQL query for the dailycounter modules. See raddb/mods-config/sql/counter/ For PosgreSQL, it's: query = "\ SELECT SUM(AcctSessionTime - GREATER((%%b - AcctStartTime::ABSTIME::INT4), 0)) \ FROM radacct \ WHERE UserName='%{${key}}' \ AND AcctStartTime::ABSTIME::INT4 + AcctSessionTime > '%%b'" Just add another AND statement which selects only the WiFi NAS. You'll have to look at your SQL DB documentation for the exact syntax. But there are tons of examples in the other SQL directories. Alan DeKok.
participants (2)
-
Alan DeKok -
Pablo Umanzor