Graphic Web Design, Computer Network, Balinese Culture

Separate and Prioritize Browsing on Mikrotik Router

Perhaps you have thought, If you give 128 kbps of the bandwidth, constraints limit was too small. But if give the bandwidth limit was raised as 256kbps, 512 kbps or greater, I was worried about going against with bandwidth monopoly when the client download is very much, it's possibility occurs bandwidth distribution inequality with some clients. the client when browsing will lose then downloader. I was thinking how to give same satisfaction for all of my clients.

So when the internet connection used with many clients the bandwidth still remains evenly distributed, which gives prioritize browsing speed against download speed, because download speed spend a lot of bandwidth for a long time.

Therefore this is essential problems for all of us. The logic is like this, the limit based on the file extension then we try to limit based by the file size.

For example, the file about to be downloaded >1MB (larger than 1 MB) then it would be categorized as Download and if <1MB (smaller than 1 MB) this is categorized as Browsing. The Confinguration is not limiting Bandwidth, but only just distinguish the priority. So if there is no client browsing the download will be fast again.

Ok I think is clear enough, and now how do we apply the browsing can be prioritize when many clients use our internet connection in mikrotik winbox.
Log in into your Winbox with a password that you have. If you not have yet, ask with your internet service provider (ISP). Look at the picture above! Go to the new terminal menu tab and right click and paste the script below at the cursor terminal command mikrotik.
/ip firewall mangle
add chain=prerouting action=mark-connection new-connection-mark=conn-download passthrough=yes protocol=tcp dst-port=80 connection-bytes=1000000-0 comment="CONN-DOWNLOAD"
add chain=prerouting action=mark-packet new-packet-mark=download-packet passthrough=no connection-mark=conn-download
add chain=prerouting action=mark-connection new-connection-mark=conn-browsing passthrough=yes protocol=tcp dst-port=80 connection-bytes=0-1000000 comment="CONN-BROWSING"
add chain=prerouting action=mark-packet new-packet-mark=browsing-packet passthrough=no connection-mark=conn-browsing

After insert the script for separation between download and browsing, you will see like the picture above. Then you can check the results by click on IP> Firewall> Mangle, look at the right picture above.

The second is create queue tree and you just need to insert the second script below.
/queue tree
add name="paket browsing" parent=global-in packet-mark=browsing-packet limit-at=0 queue=default priority=1 max-limit=0 burst-limit=0 burst-threshold=0 burst-time=0s
add name="paket download" parent=global-in packet-mark=download-packet limit-at=0 queue=default priority=8 max-limit=0 burst-limit=0 burst-threshold=0 burst-time=0s 
Go to the new terminal menu tab again, right click and paste the second script  at the cursor terminal, will shown as the picture above. Check the results by click on Queues> Queue Tree.

It's just easy way - I hope you can manage your bandwidth enforce justice against your client, good luck!
Share This Article :
Related Articles


  1. Hi,

    I have a simple network in which the following is the structure:

    Internet>> Network Switch >> ClearOS(Gateway)>> Mikrotik >> NetEqualizer2000 >> Managed Switch 24 Port>> Squid >> Users

    I started having congestion issues, so I decided to try out your simple queuing and it seemed to over-work in the sense that the Netequalizer is there to ensure that such congestions don’t occur so I think I was now double queuing them so to speak! This I did on a RB1100 Mikrotik. My main problem here is that my clients complain that when they run their email servers that they can barely download their emails!

    Now I have a backup Mikrotik X86, I have done a fresh installation on it and done the combining the simple tree for traffic congestion. It’s still early in the morning here so I will wait for peak hour to see if there would be any form of congestion on the network.

    Is there any way we can exclude an IP or 2 in particular from this second choice? As it seems to stringent on everybody and we have to bear in mind that not all the clients bought the same bandwidth plan.


    1. I have been writing a new method about bandwidth management using parent queue tree. I hope it can inspired you to manage your internet network as you wish!

    2. This is the link of the artcle

    3. Thank you, do i have to delete the previous CLI commands i have put in or i can just add these ones?

    4. Also i noticed in the page that you mentioned about your clients and the ip and the billing, i would like to know what exactly to do here, am i meant to input the ip here or what? Because i have a few clients say about 18 am i to enter all the 118 IP addresses into the CLi as the client or what exactly? please i would appreciate it if you can walk me through.

      Also is it possible to tell the Mikrotik to cut of a client at a certain date and time? or if the client has exceeded the amount of pre-allocated of bandwidth?

      Where i am bandwidth is ridiculously expensive so we have to make do with the little we can get.

      I appreciate your candid responses.

    5. The method is about how we manage the bandwidth that provided from the ISP to us as the owner of the internet network. The clients have many purposess to use the internet connection. Such as for downloading, browsing, video streams, online games ets. When one client do download any files and play video stream such a youtube, it will spend a lot of bandwidth that causes, the other client is hard just for browsing, just example. How do we set priorities of those purposes and bandwidth speed on every client that we have. So that we get the bandwidth can be shared fairly among all clients per IP address. If you want to cut one of the client, just give the client queue tree, max-limit 1k. actually the method is not for cutting the clients bandwidth, but how we manage the bandwidth per client with that have different purposes in use internet connection of our internet network.

      does it means that you want to limit bandwidth quota per clients?

    6. Yes, as they all bought different plans

    7. So many questions from others, I hope it can be help you to find the way about your wish, be patient!

    8. Try to find the answer on this artcle "" I hope can be the solution as you wish. Thank you for visiting!

  2. Hi,
    Thank you for your responses. I am indeed very grateful.
    Please i would like to know if you can explain dual wan balancing to me, or better just show me how its done.
    Thanks once again.

    1. Dual WAN Load balancing is the method to spread the bandwidth traffic of two lines of WAN with the internet connection in order to get a balanced state, so that the bandwidth traffic can run optimally. The impact of dual wan load balancing can be maximize the throughput that determines the actual bandwidth, minimise response time or ping, and avoid overload of the traffic. Actually this things being much interesting for me if i have more internet connection from other ISP. Unfortunately i can not prove it, I am feel worry to tell any more about something that i can not prove yet or just a theory. My new article about it, i could not publish it, but someday i hope! Thanks for inspired me about new idea and experience!

  3. Hi,
    i would like to find out if it is possiblle to make mikrotik share bandiwth for 20 users as i want as in maybe user 1 needs are 1mb and user 2 needs are 512kb etc; now with that done would it be possible to ensure that when users 1, 2 & 3 are online and working at peak they would not over drain bandwith from my other clients? i have 20 clients on a this particular mikrotik RB1100 and even with your Separate and Prioritize Browsing on the Mikrotik and queues i still cant get them to be less greedy and take what they have been aportioned.

    i was wondering if you could please fashion something out for me to put them in proper order?

    I await your response.


    1. I have not been so clear here what you want, if you just want to limit download and upload bandwidth with different plans per client, using simple queue and give different limit bandwidth on each client IP is enough. or you want to prioritize various kind of connections packets ?
      Prioritize various kind of connections packets arise because insufficient bandwidth that we have if divided equally per client.
      How much bandwidth totally that you have to handle 20 clients? does it use static ip ?

    2. Hi,

      Thank you for your response.

      I have allocated a total of 2mb direct fiber link from my provider to the router and with caching its usually enough tilll these greedy chaps start their nonsense!

      What i would like is a combination of the 2 as in to :
      1. limit their upload & download plans with different clients and also
      2. pioritize if possible various kinds of connection packets.

      Yes we use static IP from the Hotspot in the 10.5.50.x range

  4. I have copy and past the 2nd script but not work. giving following message.
    [akbar@CCR-BH] /queue tree> add name="paket browsing" parent=global-in packet-mark
    =browsing-packet limit-at=0 queue=default priority=1 max-limit=0 burst-limit=0 bur
    st-threshold=0 burst-time=0s =0s
    input does not match any value of parent
    [akbar@CCR-BH] /queue tree> add name="paket download" parent=global-in packet-mark
    =download-packet limit-at=0 queue=default priority=8 max-limit=0 burst-limit=0 bur
    st-threshold=0 burst-time=0se=0s

  5. I want to know what is globle-in where to get it? in second script.

  6. Hi Sir,
    i have a Wi-Fi Network with 100 users, and i am using a Mikrotik router 750g boardband, my ISP gave me 2.5Mbps. so how ca i share it to users such by limiting downloading?

    1. use limited download and unlimited browsing method using layer 7 protocol, i also add limited streaming

    2. How you made it can you please tell me

      waiting for your replay