Community discussions

MikroTik App
 
shivachitta
just joined
Topic Author
Posts: 20
Joined: Thu Nov 19, 2009 9:07 am

help regarding Mikrotik-Total-Limit ?

Fri May 28, 2010 3:44 pm

Hi all,
Im new to Mikrotik ,
FYI : im using freeradius and checking the feasibility of mikrotik 4.2

Actually my intension is to disconnect the user the once he crosses his total(upload and download) limit.
so im trying with following attribute "Mikrotik-Total-Limit" on mikrotik 4.2


The Mikrotik-Recv-Limit and Mikrotik-Xmit-Limit attributes working fine with 2.9 and 4.2 version but "Mikrotik-Total-Limit" attribute is not working on 4.2 .

Here something we observed : Radius sent "Mikrotik-Total-Limit=10000" attribute as part of Access-accept to mikrotik but we are not able to see the same in QueueList for that subscriber.


(im sending two snapshots regarding above problem , please find the attatchements )

Could someone please help me out.
You do not have the required permissions to view the files attached to this post.
Last edited by shivachitta on Mon May 31, 2010 7:39 am, edited 2 times in total.
 
User avatar
Chupaka
Forum Guru
Forum Guru
Posts: 8709
Joined: Mon Jun 19, 2006 11:15 pm
Location: Minsk, Belarus
Contact:

Re: help regarding Mikrotik-Total-Limit ?

Sun May 30, 2010 8:15 pm

for the 'Total' to be counted, you should change something in that queue: either set 'Total Max Limit', or change queue type to something else (like 'default' instead of 'default-small')... just not sure how that can be done with dynamic queues...
 
shivachitta
just joined
Topic Author
Posts: 20
Joined: Thu Nov 19, 2009 9:07 am

Re: help regarding Mikrotik-Total-Limit ?

Mon May 31, 2010 7:29 am

User has been disconnected When iam trying with "Mikrotik-Recv-Limit and Mikrotik-Xmit-Limit attributes "... but what could be problem with ""Mikrotik-Total-Limit"

i have small doubt .

1) what all mikrotik versions are supporting the "Mikrotik-Total-Limit" .
2) what is attribute value format for "Mikrotik-Total-Limit" .
( Eg: Mikrotik-Total-Limit=1000 is wright ... ?)
3) Any more attributes are to be send to make it work... ?
 
User avatar
Chupaka
Forum Guru
Forum Guru
Posts: 8709
Joined: Mon Jun 19, 2006 11:15 pm
Location: Minsk, Belarus
Contact:

Re: help regarding Mikrotik-Total-Limit ?

Mon May 31, 2010 1:33 pm

for recv and xmit you set rate limitation: 512k/1020k. that's why those queues are actually installed and count traffic. your 'total' queue has no rate limitation, and is not installed for optimization. that's why 'total' queue is not working as you expect
 
User avatar
sergejs
MikroTik Support
MikroTik Support
Posts: 6695
Joined: Thu Mar 31, 2005 3:33 pm
Location: Riga, Latvia
Contact:

Re: help regarding Mikrotik-Total-Limit ?

Mon May 31, 2010 1:43 pm

1) total-byte-limit was added at 3.0rc7 version.
2) 1000 is right, but 10k should work too.
 
shivachitta
just joined
Topic Author
Posts: 20
Joined: Thu Nov 19, 2009 9:07 am

Re: help regarding Mikrotik-Total-Limit ?

Mon May 31, 2010 2:21 pm

Hi Chupaka,

What you taking about is QoS( speed limitiations ) but what iam asking is usage limitations for the end subscriber in the perspective of session data ( quota ) and session-time.

Eg:
Iam sending "Mikrotik-Total-Limit=10000" sending to mikrotik when a subscriber allowed to use only 10000 bytes no matter of speed .


Please help me me how to do this?
 
User avatar
sergejs
MikroTik Support
MikroTik Support
Posts: 6695
Joined: Thu Mar 31, 2005 3:33 pm
Location: Riga, Latvia
Contact:

Re: help regarding Mikrotik-Total-Limit ?

Mon May 31, 2010 2:26 pm

MikroTik-Total-Limit is supported only for HotSpot users.
I see that you are using PPPoE, there are limit-bytes-in and limit-bytes-out for PPP users, but they are working in the different manner. When limit is reached PPP user is disconnected, but he/she can connect back again and use the same limit-bytes-in/limit-bytes-out values.
 
User avatar
Chupaka
Forum Guru
Forum Guru
Posts: 8709
Joined: Mon Jun 19, 2006 11:15 pm
Location: Minsk, Belarus
Contact:

Re: help regarding Mikrotik-Total-Limit ?

Mon May 31, 2010 2:48 pm

Hi Chupaka,

What you taking about is QoS( speed limitiations ) but what iam asking is usage limitations for the end subscriber in the perspective of session data ( quota ) and session-time.
I mean this: http://wiki.mikrotik.com/wiki/Manual:Qu ... ple_Queues
One configuration item in /queue simle' can create from 0 to 3 separate queues - one queue in global-in, one queue in global-out and one queue in global-total. If all properties of a queue have default values (no set limits, queue type is default), and queue has no children, then it is not actually created. This way, for exanple, creation of global-total queues can be avoided if only upload/download limitation is used.
your 'total' queue is not created, that's why it doesn't show any stats
 
doush
Long time Member
Long time Member
Posts: 665
Joined: Thu Jun 04, 2009 3:11 pm

Re: help regarding Mikrotik-Total-Limit ?

Mon May 31, 2010 3:16 pm

You have to use sql-counter module in freeradius to set volume quota for users. If you do it by attributes send to NAS, in each login users will have that exact amount set in the attribute. you should dynamically update them by sqlcounter module.
 
faniesmith
just joined
Posts: 2
Joined: Mon May 24, 2010 9:47 am

Re: help regarding Mikrotik-Total-Limit ?

Mon May 31, 2010 4:38 pm

I am trying to get the Mikrotik-Total-Limit to disconnect the user when that Hotspot User has reached a specified limit.

I have used the sqlcounter to calculate the users total data usage with the query.
sqlcounter totalbytecounter {
                counter-name = Mikrotik-Total-Limit
                check-name = Mikrotik-Total-Limit
                reply-name = Mikrotik-Total-Limit
                sqlmod-inst = sql
                key = User-Name
                reset = never
                query = "SELECT ((SUM(AcctInputOctets)+SUM(AcctOutputOctets))) FROM radacct WHERE UserName='%{%k}'"
}
I have added the
totalbytecounter
in the
authorize
section of the
 radiusd.conf
file.

The user is denied access when he tries to connect when he is over the limit. So that part of the Mikrotik-Total-Limit is working well.

The problem is that the user is not disconnected automatically when he reaches the Mikrotik-Total-Limit byte count.

I have tried to send this attribute with in the Access Accept process. The user is then only disconnected when that specific user SESSION reaches the limit specified by Mikrotik-Total-Limit.

All these tests have been done with hotspot users.

The sqlcounter attributes "Max-All-Session" And "Max-Daily-Session" disconnects the users as soon as they reach their time limits. These time limits can stretch over a few sessions.

My Problem is to get the mikrotik device to disconnect a hotspot user without having to send a disconnect request from the radclient or using the API.

Has anyone got this Mikrotik-Total-Limit to work. Any ideas will be appreciated.
 
shivachitta
just joined
Topic Author
Posts: 20
Joined: Thu Nov 19, 2009 9:07 am

Re: help regarding Mikrotik-Total-Limit ?

Tue Jun 01, 2010 7:51 am

Hi sergejs,

I tried with "hotspot" also. but no use in case "Mikrotik-Total-Limit" and "Mikrotik-Total-Limit-Gigawords" .



Radius is sending following attribute to mikrotik as a part of Access-Accept . but user is not being disconnected after his Quota ( which is 10000 ) exhausted.
"Mikrotik-Total-Limit=10000"


please send the sample log of Access-Accept who have got success with "Mikrotik-Total-Limit" .
So that it would be littile more easier to shoot out the problem.

Thanks in advance.
 
shivachitta
just joined
Topic Author
Posts: 20
Joined: Thu Nov 19, 2009 9:07 am

Re: help regarding Mikrotik-Total-Limit ?

Tue Jun 01, 2010 9:28 am

Hi All.

I want to share my problem little more clear.

FYI: I tried the following cases for both PPPoe and Hotspot.
:D In case of Mikrotik-Recv-Limit : :D

In this case following attributes have been sent to Mikrotik from Radius as part of Access-Accept

=============Attributes======================
User-Name : user1,Service-Type : Framed-User,Mikrotik-Recv-Limit : 100000 ,Mikrotik-Rate-Limit : 1024000/1024000


1) In the above case QOS speed limits has been applied for that subscriber("user1") as 1024000/1024000 for upload/download ( since Mikrotik-Rate-Limit : 1024000/1024000 has been sent )
2) Subscriber("user1") has been disconnected successfully as and when he was crossed his recv limit ( download limit not speeed limit )
( here STOP has been sent to Radius )

Conclusion : User has been disconnected successfully once he reached to his download limit in case of "Mikrotik-Recv-Limit" attributes.



:( In case of Mikrotik-Total-Limit : :(

In this case following attributes have been sent to Mikrotik from Radius as part of Access-Accept

=============Attributes======================
User-Name : user1,Service-Type : Framed-User,Mikrotik-Total-Limit: 100000 ,Mikrotik-Rate-Limit : 1024000/1024000


1) In the above case QOS speed limits has been applied for that subscriber("user1") as 1024000/1024000 for upload/download ( since Mikrotik-Rate-Limit : 1024000/1024000 has been sent )
2) :( :( Here is Problem : Subscriber is not being disconnected even after his upload/download Quota has reached .


Actually as per mikrotik documents subscriber has to be disconnected once he/she reaches his upload or download data usage to 100000 ( i.e Mikrotik-Total-Limit : 100000)

:( :( Plese guide me to solve my problem. :( :(
 
User avatar
Chupaka
Forum Guru
Forum Guru
Posts: 8709
Joined: Mon Jun 19, 2006 11:15 pm
Location: Minsk, Belarus
Contact:

Re: help regarding Mikrotik-Total-Limit ?

Tue Jun 01, 2010 9:37 am

try Recv-Limit without Rate-Limit
 
shivachitta
just joined
Topic Author
Posts: 20
Joined: Thu Nov 19, 2009 9:07 am

Re: help regarding Mikrotik-Total-Limit ?

Tue Jun 01, 2010 11:01 am

try Recv-Limit without Rate-Limit
recv-limit is working fine with or without rate-limit na ..


There would no relation b/w Recv-Limit andRate-Limit..

Anyways problem is with "Mikrotik-Total-Limit" not with "Recv-Limit and Rate-Limit"



Please can anyone help......?

Please share their success with "Mikrotik-Total-Limit"....
 
shivachitta
just joined
Topic Author
Posts: 20
Joined: Thu Nov 19, 2009 9:07 am

Re: help regarding Mikrotik-Total-Limit ?

Fri Jun 04, 2010 12:44 pm

Can any body help in this regard...?
 
User avatar
sergejs
MikroTik Support
MikroTik Support
Posts: 6695
Joined: Thu Mar 31, 2005 3:33 pm
Location: Riga, Latvia
Contact:

Re: help regarding Mikrotik-Total-Limit ?

Fri Jun 04, 2010 12:45 pm

We are waiting for the report, when 4.10 version is used.
 
shivachitta
just joined
Topic Author
Posts: 20
Joined: Thu Nov 19, 2009 9:07 am

Re: help regarding Mikrotik-Total-Limit ?

Thu Jun 10, 2010 3:06 pm

Hi sergejs,

sorry for late replay....
Anyways we tried and got success with Version 4.10. Thank you very much..............

"Mikrotik-Total-Limit" is working fine in 4.10 version .

But i have some questions, please tel me
1) where can we see present quota left out of total-quota for that session/user.
2) From which version onwards it is working.?


Please reply me..
 
stbox
just joined
Posts: 3
Joined: Sat Nov 24, 2012 4:11 pm

Re: help regarding Mikrotik-Total-Limit ?

Fri Dec 14, 2012 8:06 pm

for recv and xmit you set rate limitation: 512k/1020k. that's why those queues are actually installed and count traffic. your 'total' queue has no rate limitation, and is not installed for optimization. that's why 'total' queue is not working as you expect

hi
i want to disconnect a user after end of trafic !
my raduis serves us nttac+
How can I Send Total-Limit to Mt
i want to set trafic limit for users !
tnx !
 
User avatar
aacable
Member
Member
Posts: 435
Joined: Wed Sep 17, 2008 11:58 am
Location: ISLAMIC Republic of PAKISTAN
Contact:

Re: help regarding Mikrotik-Total-Limit ?

Wed Mar 16, 2016 11:13 am

I am trying to get the Mikrotik-Total-Limit to disconnect the user when that Hotspot User has reached a specified limit.

I have used the sqlcounter to calculate the users total data usage with the query.
sqlcounter totalbytecounter {
                counter-name = Mikrotik-Total-Limit
                check-name = Mikrotik-Total-Limit
                reply-name = Mikrotik-Total-Limit
                sqlmod-inst = sql
                key = User-Name
                reset = never
                query = "SELECT ((SUM(AcctInputOctets)+SUM(AcctOutputOctets))) FROM radacct WHERE UserName='%{%k}'"
}
I have added the
totalbytecounter
in the
authorize
section of the
 radiusd.conf
file.

The user is denied access when he tries to connect when he is over the limit. So that part of the Mikrotik-Total-Limit is working well.

The problem is that the user is not disconnected automatically when he reaches the Mikrotik-Total-Limit byte count.

I have tried to send this attribute with in the Access Accept process. The user is then only disconnected when that specific user SESSION reaches the limit specified by Mikrotik-Total-Limit.

All these tests have been done with hotspot users.

The sqlcounter attributes "Max-All-Session" And "Max-Daily-Session" disconnects the users as soon as they reach their time limits. These time limits can stretch over a few sessions.

My Problem is to get the mikrotik device to disconnect a hotspot user without having to send a disconnect request from the radclient or using the API.

Has anyone got this Mikrotik-Total-Limit to work. Any ideas will be appreciated.
sorry to makeup very old thread. i am also facing same problem that once data limit reaches, user still continue to download, he is not disconnecting automatically. Once he disconnect himself, and retry login then he gets access deny.
how to disconnect user auto when data limit reaches?
 
User avatar
aacable
Member
Member
Posts: 435
Joined: Wed Sep 17, 2008 11:58 am
Location: ISLAMIC Republic of PAKISTAN
Contact:

Re: help regarding Mikrotik-Total-Limit ?

Sat Mar 26, 2016 7:24 am

never mind. i managed to make it work with the COA :D
https://aacable.wordpress.com/2016/03/2 ... oa-part-2/.

Who is online

Users browsing this forum: Bing [Bot], deatras, randomseed and 96 guests