[OT] accel-pppd i radius
Witam Czy ktoś z lms'owiczów używa z lmsem radiusa w połączeniu z accel-pppd z shapeingiem? Chodzi mi jakie konkretnie wartości zwrócić z radiusa by wartości to shapeingu były dynamicznie ustawiane? Dla mikrotika zwracam *Mikrotik-Rate-Limit* a co zwrócić dla accel-pppd?
z góry dzięki
Ja używam.
Filter-Id
authorize_reply_query = "SELECT id, lower(name) as UserName , 'Framed-IP-Address' as Attribute, inet_ntoa(ipaddr) as Value, '==' as op \ FROM nodes \ WHERE name = '%{User-Name}' \ UNION \ SELECT 0 AS id, '%{User-Name}' AS UserName, 'Filter-Id' AS Attribute, \ CONCAT(ROUND(COALESCE(x.downceil, y.downceil, z.downceil)),'/', ROUND(COALESCE(x.upceil, y.upceil, z.upceil))) AS Value, ':=' AS op \ FROM (SELECT n.id, MIN(n.name) AS name, SUM(t.downceil/o.cnt) AS downceil, SUM(t.upceil/o.cnt) AS upceil \ FROM nodeassignments na JOIN assignments a ON (na.assignmentid = a.id) JOIN tariffs t ON (a.tariffid = t.id) \ JOIN nodes n ON (na.nodeid = n.id) JOIN (SELECT assignmentid, COUNT(*) AS cnt FROM nodeassignments GROUP BY assignmentid \ ) o ON (o.assignmentid = na.assignmentid) WHERE (a.datefrom <= unix_timestamp() OR a.datefrom = 0) \ AND (a.dateto > unix_timestamp() OR a.dateto = 0) AND a.suspended = 0 AND n.name = '%{User-Name}' \ GROUP BY n.id \ ) x \ LEFT JOIN ( \ SELECT SUM(t.downceil)/o.cnt AS downceil, \ SUM(t.upceil)/o.cnt AS upceil \ FROM assignments a \ JOIN tariffs t ON (a.tariffid = t.id) \ JOIN nodes n ON (a.customerid = n.ownerid) \ JOIN (SELECT COUNT(*) AS cnt, ownerid FROM nodes \ WHERE NOT EXISTS (SELECT 1 FROM nodeassignments, assignments a \ WHERE assignmentid = a.id AND nodeid = nodes.id \ AND a.suspended = 0 AND (a.dateto > unix_timestamp() OR a.dateto = 0)) \ GROUP BY ownerid \ ) o ON (o.ownerid = n.ownerid) \ WHERE (a.datefrom <= unix_timestamp() OR a.datefrom = 0) \ AND (a.dateto > unix_timestamp() OR a.dateto = 0) AND a.suspended = 0 \ AND NOT EXISTS (SELECT 1 FROM nodeassignments WHERE assignmentid = a.id) \ AND n.name = '%{User-Name}' \ GROUP BY n.id \ ) y ON (1=1) \ RIGHT JOIN (SELECT n.id, n.name, 256 AS downceil, 256 AS upceil \ FROM nodes n WHERE n.name = '%{User-Name}' \ ) z ON (1=1);" }
Pozdrawiam,
SP
W dniu 02.02.2018 o 08:21, Marcin pisze:
Witam Czy ktoś z lms'owiczów używa z lmsem radiusa w połączeniu z accel-pppd z shapeingiem? Chodzi mi jakie konkretnie wartości zwrócić z radiusa by wartości to shapeingu były dynamicznie ustawiane? Dla mikrotika zwracam /Mikrotik-Rate-Limit/ a co zwrócić dla accel-pppd?
z góry dzięki
-- Pozdrawiam Marcin / nicraM
lms mailing list lms@lists.lms.org.pl http://lists.lms.org.pl/mailman/listinfo/lms
Wielkie dzięki. Masz zgrzewkę dobrego browaru ode mnie
2018-02-02 9:31 GMT+01:00 Sławomir Paszkiewicz paszczus@gmail.com:
Ja używam.
Filter-Id
authorize_reply_query = "SELECT id, lower(name) as UserName , 'Framed-IP-Address' as Attribute, inet_ntoa(ipaddr) as Value, '==' as op \ FROM nodes \ WHERE name = '%{User-Name}' \ UNION \ SELECT 0 AS id, '%{User-Name}' AS UserName, 'Filter-Id' AS Attribute, \ CONCAT(ROUND(COALESCE(x.downceil, y.downceil, z.downceil)),'/', ROUND(COALESCE(x.upceil, y.upceil, z.upceil))) AS Value, ':=' AS op \ FROM (SELECT n.id, MIN(n.name) AS name, SUM(t.downceil/o.cnt) AS downceil, SUM(t.upceil/o.cnt) AS upceil \ FROM nodeassignments na JOIN assignments a ON (na.assignmentid = a.id) JOIN tariffs t ON (a.tariffid = t.id) \ JOIN nodes n ON (na.nodeid = n.id) JOIN (SELECT assignmentid, COUNT(*) AS cnt FROM nodeassignments GROUP BY assignmentid \ ) o ON (o.assignmentid = na.assignmentid) WHERE (a.datefrom <= unix_timestamp() OR a.datefrom = 0) \ AND (a.dateto > unix_timestamp() OR a.dateto = 0) AND a.suspended = 0 AND n.name = '%{User-Name}' \ GROUP BY n.id \ ) x \ LEFT JOIN ( \ SELECT SUM(t.downceil)/o.cnt AS downceil, \ SUM(t.upceil)/o.cnt AS upceil \ FROM assignments a \ JOIN tariffs t ON (a.tariffid = t.id) \ JOIN nodes n ON (a.customerid = n.ownerid) \ JOIN (SELECT COUNT(*) AS cnt, ownerid FROM nodes \ WHERE NOT EXISTS (SELECT 1 FROM nodeassignments, assignments a \ WHERE assignmentid = a.id AND nodeid = nodes.id \ AND a.suspended = 0 AND (a.dateto > unix_timestamp() OR a.dateto = 0)) \ GROUP BY ownerid \ ) o ON (o.ownerid = n.ownerid) \ WHERE (a.datefrom <= unix_timestamp() OR a.datefrom = 0) \ AND (a.dateto > unix_timestamp() OR a.dateto = 0) AND a.suspended = 0 \ AND NOT EXISTS (SELECT 1 FROM nodeassignments WHERE assignmentid = a.id) \ AND n.name = '%{User-Name}' \ GROUP BY n.id \ ) y ON (1=1) \ RIGHT JOIN (SELECT n.id, n.name, 256 AS downceil, 256 AS upceil \ FROM nodes n WHERE n.name = '%{User-Name}' \ ) z ON (1=1);" }
Pozdrawiam,
SP
W dniu 02.02.2018 o 08:21, Marcin pisze:
Witam Czy ktoś z lms'owiczów używa z lmsem radiusa w połączeniu z accel-pppd z shapeingiem? Chodzi mi jakie konkretnie wartości zwrócić z radiusa by wartości to shapeingu były dynamicznie ustawiane? Dla mikrotika zwracam *Mikrotik-Rate-Limit* a co zwrócić dla accel-pppd?
z góry dzięki
-- Pozdrawiam Marcin / nicraM
lms mailing listlms@lists.lms.org.plhttp://lists.lms.org.pl/mailman/listinfo/lms
lms mailing list lms@lists.lms.org.pl http://lists.lms.org.pl/mailman/listinfo/lms
uczestnicy (2)
-
Marcin
-
Sławomir Paszkiewicz