Sunday, May 9, 2021

Mikrotik Limit Bandwidth on Interface

In Mikrotik, as we can limit the bandwidth for a user, in the same way, we can limit the bandwidth for an ethernet interface also. The restriction applied on a user basis will work only for that specific user. On the other hand, the restriction applied on the interface basis will work for all the users, who are using that interface. 

Suppose the 5 Mbps restriction is applied on an interface, in that case, all the users who are going to use that interface will be restricted into that 5 Mbps bandwidth. This 5 Mbps bandwidth will be distributed unequally among all the users.

But if we want every user to have to get 5Mbps equal bandwidth for their respective connection, in that case, we have to use a special queue type called "PCQ (Per Connection Queue)".

In this tutorial, we will learn both of the processes. The process for equal distribution as well as the process for unequal bandwidth distribution also. We will use the "Winbox" tool to complete those processes.

We will start with the unequal distribution process. After login your router, go to the "Queue" menu and then navigate to "Simple Queue". Their click on add (+) sign to add a new rule.


Now specify a name for your queue rule and select the target interface that you want to restrict. Then specify the maximum upload and download limit for that target interface. In this tutorial, we are assuming that our target interface is "ether2".


That's it.  The unequal 5Mbps bandwidth distribution configuration is done. From now on the interface "ether2" will be restricted by 5Mbps bandwidth. All the users who are going to use this interface, they will be bounded within this 5Mbps bandwidth and this bandwidth will distribute on an unequal basis.

Now we will discuss the equal bandwidth distribution process. According to our scenario, we have to ensure that every user will get 5Mbps dedicated upload and download bandwidth for their respective connection.

Now create a new rule and specify a name for that rule. According to our scenario, select the "ether2" interface as the "Target" parameter value. In this case, we will not define any maximum download or upload limit. Leave it with default settings.


Now we have to change our default queue type. By default, Mikrotik uses the "default-small" queue for applying the upload and download bandwidth restriction. We can change it using the "Advanced" tab.


Instead of using the "default-small" queue type, we have to use the "PCQ" queue type.


If we want we can use this existing PCQ queue type or we can create a new type for our upload and download restriction. In this tutorial, we will create a new queue type to achieve our target. We have to create two queue types. One queue will work for the download restriction and the second queue will work for the upload restriction.

To create a new queue type, please navigate to the "Queue Types" tab from the "Queues" menu and then click on the (+) sign to create a new type.


After clicking on the (+) sign, please change the queue type to "pcq" from the "Kind" parameter.


Now we will write the bandwidth amount into the "Rate" field. According to our scenario, we want to ensure that every user will get 5mbps dedicated upload and download bandwidth respective to their connection.


Mind that, we have to create two new queue types. One is for download and the other is for upload restriction.

For download queue type, we have to select "Dst. Address" as the classifier value. 


For upload queue type, we have to select "Src. Address" as the classifier value.


That's it. After clicking on the "Apply" and "OK" button, our queue will ready to work.

Now we have to change our "Queue Type" value to the newly created custom queue type. We have to change both of the queue types mean one is for upload and the other is for download.


Everything is done. From now on all the uses should get 5mbps upload and download bandwidth respective to their connection. The bandwidth will distribute equally among all the users.

In this tutorial, we learned how to distribute bandwidth on an equal and unequal basis among all the users. In another word, we learned how to limit bandwidth on an interface




No comments:

Post a Comment