How to limit bandwidth usage per TCP connection?

What’s the most efficient way of accomplishing the following?

This is the network:
(10 computers) – Switch – D-Link NAT - Mikrotik - Internet.

I don’t have control of anything to the left of the Mikrotik, so don’t tell me to change it :slight_smile:

What I want to do is limit the speed of each TCP connection from any of the 10 computers to the Internet at 2 Mbps.
So if someone is downloading a file, they’ll have a maximum speed of 2 Mbps but if they are downloading 2 files from different sources they’ll get 2 Mbps each (so 4 Mbps in total).

I need to implement this because occasionally the connection to the Internet gets maxed out, and voip/games stop working, when one person downloads a file from a fast source. Keep in mind that to the router, all the computers look like they have the IP 10.20.30.40 so I can only limit per connection, not per computer.

thanks

why you doesn’t use mikrotik as NAT device instead of dlink?
Using mikrotik you can set up a simple queue with pcq type. With this kind of que you can set a maximum rate and you can equally share bandwidth.

Because this one routerboard is used as a main router and can’t be re-located and setting up a new queue is easier/cheaper than getting another routerboard.

I figured out this problems involves PCQ but I’m not sure what settings/numbers go where.
I can limit all connections to 2 Mbps combined, but not 2 Mbps per connection.

I created a PCQ (based on src and dst addr) with a rate of 2Mbps and assigned it to the interface which is connected to the switch but nothing changed.