How to limit users bandwidth on spesific connection ?

Hi all,

How to limit user bandwidth on specific connection ?
the example needs as follows :

  • if users just browse the internet, than any user can use any available bandwidth.
  • if one of the users doing download (transfer rate more than 32Kbps continuesly more than 5 minute) and add the destination server to address list with time out 1 hour, let say it will named with download-server
  • all address-list on download-server will be put on mangle and than to be limited on simple queue or queue tree.

is it possible ?

Paul

There is no such function to limit bandwidth in the described way, but I think PCQ queue for all available bandwidth is good alternative.
For example, Internet link bandwidth is 10Mbps, you set one PCQ queue that divides 10Mbps between all clients equally. One client is online, it gets 10Mbps, two clients are online they divide 10Mbps/2, etc.
http://wiki.mikrotik.com/wiki/Manual:Queues_-_PCQ

Thx sergej,

Quite confuse. I think may be connection-bytes can help.

what is connection-bytes purposes ?

Paul

Yes, you can use connection-bytes and try to make complicated setups, which could try to give you bandwidth limit to specific connection.

But PCQ solution will be much better. You can search in the forum for burst topic, that has many posts about similar problem.

It should be possible by connection-bytes - just one simple rule, if connection bytes are over - let’s say - 5M (connection-bytes=5000000-0) and in-interface is WAN, then add src-address to the address list

That would rate limit ALL the user’s connections, since the source address is the same for all of them.

I got the following codes from some other forum :

/ip firewall filter add action=add-dst-to-address-list address-list=limited address-list-timeout=1h chain=forward comment=“Volume Above 512K” connection-bytes=512000-0 disabled=no protocol=tcp
/ip firewall mangle add chain=forward protocol=tcp src-address-list=limited action=mark-packet new-packet-mark=limit-by-volume
/queue simple add name=limit-files max-limit=32000/128000 packet-marks=limit-by-volume

and it seems quite help.

Any advices for improvement ?

Paul