On Jul 10, 2019, at 12:53 AM, Ali Arslan via Freeradius-Users <freeradius-users@lists.freeradius.org> wrote:
To update users rate-limits dynamically i have defined following custom attributes in dictionary file ,,, and written following unlang codes in accounting section: .. if i test it with a user for Mikrotik nas for which GetRate sql function returns 2048k/16324k rate string the relevant part in freeradius debug output is:
That's a pretty good design, and a good summary.
(1) Sent Accounting-Response Id 1 from 127.0.0.1:1813 to 127.0.0.1:61732 length 0 (1) Mikrotik-Rate-Limit = "2048k/16324k" (1) Finished request
all look fine, but the reply message Mikrotik-Rate-Limit = "2048k/16324k" is not conformed.
Yes. The NAS will ignore the contents of the Accounting-Response packet.
But if i set Mikrotik-Rate-Limit = "2048k/16324k" in radreply table atleast upload rate is obeyed.
Do i update reply in wrong place, or doing some other things wrong?
You need to send an empty Accounting-Response packet. And *also* a CoA-Request packet to the NAS. See sites-available/originate-coa for details. The CoA-Request packet will need to contain attributes that identify the user session. Typically this is User-Name, NAS-Identifier, NAS-Port, etc. The exact list is found either in the NAS documentation, or by trial & error via testing. Typically you can just copy the relevant attributes from the Accounting-Request packet into the CoA-Request packet. Alan DeKok.