Graphic Motion Video Art, Website, IT Network, Culture

Loading...
Bandwidth Management on Mikrotik using Winbox

Bandwidth share with PCQ (Per Connection Queue) principally is using the queue method to specify the bandwidth usage on the multiple clients. PCQ in the Mikrotik router already installed by default and a program to manage internet traffic network QoS (Quality of Service ). The Method of  Bandwidth Management here in order to share bandwidth internet connection is equal among client that you have.

For example we have the internet connection bandwidth of 2000 kbps, and we want to share to 10 clients that will get the bandwidth allotted 2000/10 kbps = 200 kbps. and if  we have 5 client that use the internet will divide 2000/5 kbps = 400 kbps. When 10 client using at the time, at the peak condition will get bandwidth quota around 100 kbps each other. Ok let's practice this !

  • Assuming we have local network address 192.168.1.0/24 and the interface that connected to the local area network we called as "lan". and the interface that lead that led to the Internet Service Provider (ISP) we called as "public" (note it is up to you give the name of the interface, the function is just distinguish  where the name intranet and internet).
  • We will use Mikrotik Winbox to be interface software tool
  • We will create a firewall setting mark

1. Okay we begin from the First Command
/ip firewall mangle add chain=forward src-address=192.168.1.0/24 action=mark-connection new-connection-mark=NET1-CM
Go to Winbox and, select IP > firewall >Mangle tab then click on "+" button will shown as the picture below:

On the General tab as shown as the picture above fill Chain : with forward, and Src Address : with local network IP address (192.168.1.0/24). After that still on Mangle Rule go to Action tab, will shown as the picture below :


Fill the form fields as shown as the picture above! if you do was right the result can be seen by click on  IP > Firewall  as shown below!

2. The second command is
/ip firewall mangle add connection-mark=NET1-CM action=mark-packet new-packet-mark=NET1-PM chain=forward
in order to making mark packet
enter through IP > firewall > mangle tab then click on  "+" button


You just need to set up chain = forward and Connection Mark = NET1-CM, then go to the action tab


Completed the fields as the picture above, if you do was right, you can see the results by clicking again on IP > Firewall , as shown like the picture bellow :


3. The Third Command is Making queue types “with name of pcq_downstream”
/queue type add name=pcq_downsteam kind=pcq pcq-classifier=dst-address
Return to the main menu select Winbox Queues at Queue List select tab Queue Types then press button "+"

Completed the field as shown like the picture above!, Limit and Total Limit is depending on the ISP bandwidth that you have, in this case the internet connection that use is up to 2 mbps.

4. the Fourth Command is to make queue types “with name pcq_upstream”
/queue type add name=pcq_upstream kind=pcq pcq-classifier=src-address
Still on the main menu select Winbox Queues at Queue List select tab Queue Types then press "+"  button

 Just like downsteam, upsteam settings as above to adjust with your internet connection limitation totally

5. The Fifth Command is to make queue tree interface “lan”
/queue tree add parent=lan queue=pcq_downsteam packet-mark=NET1-PM
Starting from the main menu select Winbox again Queues at Queue List select tab Queue Three then press "+"  button
  
Adjust the settings as shown like the picture above, the difference is the Parent, depending on your internet connection of your ISP, if you do not know, you can see that by clicking on the menu Interface from the main menu Winbox

In this case the name of  lan interface is ether1, public interface is wlan1.  if you have already know, completed with your Parent according with the name of your lan interface.

6. the Sixth Command is to make queue tree interface “public”
/queue tree add parent=public queue=pcq_upstream packet-mark=NET1-PM
begin from the main menu select Winbox again Queues at Queue List select tab Queue Three then press  "+"  button

Surely you can guess already what is the difference about the picture above that is the fields of the Parent, adjust the name according to your public interface.

Ok from six steps above I could have a summary. This is the short way if you don't want to take a long time. Go to the main menu of the winbox, this is the following practical steps:
/ip firewall mangle add chain=forward src-address=192.168.1.0/24 action=mark-connection new-connection-mark=NET1-CM
/ip firewall mangle add connection-mark=NET1-CM action=mark-packet new-packet-mark=NET1-PM chain=forward
/queue type add name=pcq_downsteam kind=pcq pcq-classifier=dst-address
/queue type add name=pcq_upstream kind=pcq pcq-classifier=src-address
/queue tree add parent=lan queue=pcq_downsteam packet-mark=NET1-PM
/queue tree add parent=public queue=pcq_upstream packet-mark=NET1-PM
Copy the six comment above into the notepad, and change the IP address marked with red color, green color is lan interface, public interface marked with blue, according to your internet connection. Then go to the main menu of Winbox, and click on the New Terminal. After you have changes the six steps above, then paste by right click on the active Terminal at the cursor.

For more details, let's see the following video ! hopefully useful for you and good luck!


Share This Article :
Related Articles

23 comments :

  1. Its really informative, the features and other points mentioned in detail are quite considerable and to the point as well, would be so far better idea to look for more of that kind to have better results.

    Hvac Service Management Software

    ReplyDelete
  2. I wanted somethings as clear as possible and not make confusion, thank you for the appreciation!

    ReplyDelete
  3. I'm very interested in this method so much. i followed your steps but it doesn't work for me. Please advise :)

    ReplyDelete
    Replies
    1. in what way? what kind of problem of yours?

      Delete
    2. my bandwidth=9mb/9mb, i have 3 active pc running, pc1 & pc2 for browsing internet n pc3 is downloading with internet download manger. pc3 get almost 9mb. bandwidth is not equal for each pc (it should be 3mb if there are 3 active pc running). pls advicse.

      Delete
    3. I think I must to test this method at first, be patient...! we learn together

      Delete
    4. /ip firewall mangle
      add chain=prerouting action=mark-packet in-interface=wlan1 new-packet-mark=client_upload
      add chain=prerouting action=mark-packet in-interface=ether1 new-packet-mark=client_download

      /queue type
      add name=pcq_downsteam kind=pcq pcq-rate=256000 pcq-classifier=dst-address
      add name=pcq_upstream kind=pcq pcq-rate=220000 pcq-classifier=src-address

      /queue tree
      add parent=global-in queue=pcq_downsteam packet-mark=client_download
      add parent=global-out queue=pcq_upstream packet-mark=client_upload

      Delete
    5. pcq-rate is max-limit that will given to each client if bandwidth is enough. if it doesn't enough, the bandwidth will be shared equal for all client with the smaller value!

      wlan1 = public interface
      ether1 = local interface

      Delete
    6. If you want to use simple queue, remove queue tree, and try this!
      /queue simple
      add name=equal_all target-addresses=192.168.1.0/24 queue=pcq_upstream/pcq_downsteam \
      packet-marks=client_download,client_upload total-queue=default

      Delete
  4. thanks bro

    http://freakscontent.blogspot.com/

    ReplyDelete
  5. Thank so much.. Really helped alot..

    Keep it up bro..

    ReplyDelete
  6. hi, you can explain me about Mangle rule is clear or you have document? send to me sokengchorn@gmail.com
    thank!!!

    ReplyDelete
  7. This is good. Also found this: http://www.computing-tips.net/Bandwith_Limit_on_a_Mikrotik_Router/

    ReplyDelete
  8. Is this work for hotspot users?

    ReplyDelete
  9. If this will not work for hotspot user..thn plz help me to equally distribute bandwidth amoung hotspot user

    ReplyDelete
  10. Is this work for hotspot users?

    ReplyDelete
  11. Is this work for hotspot users?

    ReplyDelete
  12. Is this work for hotspot users?

    ReplyDelete
  13. Very helpful suggestions that help in the optimizing website. thank for sharing the link.

    หนังออนไลน์

    ReplyDelete
  14. Convergent billing platform for ISP, Wifi, IPTV, OTT, TV-Anywhere, Pay-TV, DTH, DTT. A complete end to end OSS/BSS Solution Platform which helps ISP and Telecom Operator run their Broadband business
    https://www.iconwavetech.com/

    ReplyDelete

Back to Top