Community discussions

MikroTik App
 
Krisken
Member Candidate
Member Candidate
Topic Author
Posts: 136
Joined: Thu Oct 25, 2012 11:35 am

Limit download/upload speed per IP

Wed Feb 12, 2014 5:07 pm

Hello guys,

I've searched on this forum and on google, i've found 100's of exemples how to do this but it seems to be that they are plenty ways to fix it, with lots of options that i don't have it clear. I hope that one of you can explain me the most simple way to limit the download and upload speed per IP address.

Short story:
- IP range is 10.0.0.0/24
- IP of routerboard id 10.0.0.1
- max downloadspeed per IP is 10Mbit
- max uploadspeed per IP is 10Mbit
- Port 1, 2, 3 are in a bridge called "bridge1 - Bureau" (LAN)
- WAN is port 6 called "ether6 - Verixi"

Thanks for any solution!!!
 
User avatar
rickfrey
Trainer
Trainer
Posts: 609
Joined: Sun Feb 14, 2010 11:41 pm
Location: Van, Texas
Contact:

Re: Limit download/upload speed per IP

Wed Feb 12, 2014 5:47 pm

Assuming, that you can handle the bridge and other peices, here is the queue piece. This will work on ROS 6.7:

/queue simple
add max-limit=10M/10M name=Example queue=pcq-upload-default/pcq-download-default target=10.0.0.0/24
 
Krisken
Member Candidate
Member Candidate
Topic Author
Posts: 136
Joined: Thu Oct 25, 2012 11:35 am

Re: Limit download/upload speed per IP

Wed Feb 12, 2014 6:07 pm

I think that this isn't the correct solution, is this possible? When i do a speedtest with 2 pc's (at the same time) i have 5mbit up and 5mbit down on each. I want to limit the speed so that the maximum speed per ip is 10mbit, not in total for an interface. The uplink (WAN) is 1Gbit, I just don't want that my users download at 1Gbit.
 
User avatar
rahulmkhj
Member Candidate
Member Candidate
Posts: 135
Joined: Wed Mar 09, 2011 10:54 am

Re: Limit download/upload speed per IP

Wed Feb 12, 2014 7:26 pm

I think that this isn't the correct solution, is this possible? When i do a speedtest with 2 pc's (at the same time) i have 5mbit up and 5mbit down on each. I want to limit the speed so that the maximum speed per ip is 10mbit, not in total for an interface. The uplink (WAN) is 1Gbit, I just don't want that my users download at 1Gbit.
There are two ways to do that.
i) add multiple queues (1 per IP). (which doesn't seem like a good idea to me.)
ii) define two new PCQs queue types. (1 for download & 1 for upload)

I use winbox most of the times .. so don't remember the exact cli commands.
but in winbox .. you'll have to go to Queues -> Queue Types -> Add(+)
give it a name: say.. 10M-Download, kind=pcq, rate=10M, Classifier=DstAddress .. for rest defaults are OK.
add another one:
name = 10M-Upload, kind=pcq, rate=10M, Classifier=SrcAddress.

Now go to "simple queues" add a new one..
name it whatever you want.. with target address being the subnet you want to apply limits on. (LEAVE UPLOAD/DOWNLOAD LIMITS TO UNLIMITED ON THIS TAB).

and in advance tab of this queue, change the queue type to the one you've just created.
Hit apply/ok and you're done. :)

Post back for any clarifications.
 
TikUser
newbie
Posts: 48
Joined: Thu Jul 04, 2013 2:40 pm
Location: EU

Re: Limit download/upload speed per IP

Thu Feb 13, 2014 1:12 pm

In the Simple Queue the upload/download max limit MUST be specified. This is the limit for ALL users. The PCQ needs to know how much available bandwidth it has. In the PCQ Rate you specify limit per ONE user (maximal available data rate of each sub-stream).

Example: If the max. download limit is 10Mb, and you specify 3Mb in the PCQ Rate, every user will get max. 3Mb, even if in that moment the internet connection can give him more than that. If You type 0 in the PCQ Rate, PCQ will divide the 10Mb max. limit equally between users.

Read this wiki for detailed explanation.
For a precise PCQ queue behavior, I would suggest that You specify both -> the max. limit and the PCQ Rate limit(not 0).
 
Krisken
Member Candidate
Member Candidate
Topic Author
Posts: 136
Joined: Thu Oct 25, 2012 11:35 am

Re: Limit download/upload speed per IP

Thu Feb 13, 2014 4:07 pm

So this solution isn't correct:

http://pastebin.com/jNmr8e6A
 
TikUser
newbie
Posts: 48
Joined: Thu Jul 04, 2013 2:40 pm
Location: EU

Re: Limit download/upload speed per IP

Fri Feb 14, 2014 12:08 am

No. You wrote that your download speed is 1Gbit(1000Mb). If that really is the case, then 1000Mb is your download max. limit. If your upload speed is also 1000Mb, then this is Your upload max limit. Your PCQ upload/download queues seem ok. Just add them in the Advanced tab under Queue Type.
Look at the pictures in the attachment.
You do not have the required permissions to view the files attached to this post.
 
drdedus
just joined
Posts: 14
Joined: Thu Mar 17, 2016 6:24 pm

Re: Limit download/upload speed per IP

Fri Mar 18, 2016 1:07 pm

I do not understand what us happening.
I have the router with default configuration and I just add limits like you mentioned.
I have only one bridge and this I put in "target".
The limits is working great, metered with 3 devices.
But sometimes it is not working and I can not see the traffic in queues exept some small kbps.

I change the target from bridge and I put ip range 192.168.88.0/24 and is workind well.
I remove the mikrotik from the wall and the limits is not working.
I removed again and is working.
What is happening??
 
MLubbe
newbie
Posts: 32
Joined: Fri Mar 18, 2016 7:40 pm

Re: Limit download/upload speed per IP

Fri Mar 18, 2016 9:13 pm

Perhaps this will do the trick for you:

Open Winbox and login to Mikrotik then run the following script in the terminal.

What it does is limit all devices in the 192.168.1.0/24 range individually to 2Mbps up and down.

You can modify this script to meet your requirements, and network layout.
> Enter speed limit up/down on pcq-rate.
> Modify "target=192.168.1.0/24" to match your local / client network range.
# Limit Bandwidth of each IP in an entire subnet:
/queue type
add kind=pcq name=pcq-upload-custom pcq-classifier=src-address pcq-rate=2M
add kind=pcq name=pcq-download-custom pcq-classifier=dst-address pcq-rate=2M
/queue simple
add name=Throttle-Each queue=pcq-upload-custom/pcq-download-custom \
target=192.168.1.0/24
 
drdedus
just joined
Posts: 14
Joined: Thu Mar 17, 2016 6:24 pm

Re: Limit download/upload speed per IP

Sat Mar 19, 2016 12:35 pm

thank you very much.
I tried but it is not working.
it is very weird because im getting ip from the range of the simple queue and the router have the default configuration.
 
jarda
Forum Guru
Forum Guru
Posts: 7756
Joined: Mon Oct 22, 2012 4:46 pm

Sun Mar 20, 2016 2:58 am

Is the fasttrack on? If yes it prevents the queues to work. Switch it off.
 
drdedus
just joined
Posts: 14
Joined: Thu Mar 17, 2016 6:24 pm

Re: Limit download/upload speed per IP

Sun Mar 20, 2016 2:00 pm

Thank you
The problem appeared in 2 mikrotik boxes with default configuration.
i had reset the router and i configured again and now is working.

What is the "fasttrack" and were i can find it?

By the way i have a very small line 1Mbit / 4Mbit .
i have limit the bandwith now to 500k / 2M .
i want to try to give all the bandwith and leave mikrotik to give equal to users.
is this better idea does this function workin well?
What is the simpest option to do that?
 
LeJoker
just joined
Posts: 1
Joined: Sat Feb 11, 2017 2:09 am

Re: Limit download/upload speed per IP

Sat Feb 11, 2017 2:11 am

Is the fasttrack on? If yes it prevents the queues to work. Switch it off.
I realize this post is nearly a year old and I'm not the original poster, but this solved my issue. Thank you!

Who is online

Users browsing this forum: No registered users and 49 guests