Multilogin accounting Problem
aland at deployingradius.com
Sat Jan 16 16:40:43 CET 2016
On Jan 16, 2016, at 2:44 AM, Arash Shams <ara4sh at hotmail.com> wrote:
> for example i have a daily service with 4gb bandwidth . i logged in 3 devices with same username (simultaneous-use) now i have 12 gb service means each device gets 4 gb instead of all of them have 4 gb together
That's because you allowed all 3 devices on the network at the same time, and you gave all of them the full bandwidth allowance.
The simple answer is "don't do that".
At the minimum, you need to track the current bandwidth which has been used, and subtract that from the 4G daily allowance. This should be done every time the user logs in. That solves the bandwidth allowance for one user.
If you allow the user to log in multiple times, the only real solution is to divide the allowed bandwidth by the number of times he's allowed to log in. That can then be used as a per-session limit. If the NAS supports bandwidth limitation (most don't), it will kick the user off once he's reached the session limit. He can then retry, and get more bandwidth if he still hasn't reached the daily limit.
i.e. session limit = (4G - total used today over ALL sessions) / (number of simultaneous sessions allowed)
More information about the Freeradius-Users