Mikrotik – How To Speed Limit With DHCP?

In this article, Mikrotik devices and DHCP Server is the desire to make an IP based speed limit. We will now see how to do this together. For example, when the user requests an IP, the DHCP Server adds a rule about speed while giving IP. When DHCP lease time expires or is deleted from the lease list, our rule with speed limitation will also be disabled.

Of course, we need to pay attention to a subject here. If the user has given a manual IP address, that user is not subject to the speed limit. To avoid such a situation, you should write a rule that will affect your entire network.

If everyone gets IP from DHCP and manual IP address can be prevented, user-based speed stabilization can be done and we have the opportunity to monitor their speed from the.

We will need to use a script to do this. We will use the following script.

In the example we will do, we have given the Download value 4M, the upload value 512kbit. (limit-at = 512k / 4M max-limit = 512k / 4M)

If you want to change it, you can change the values in “limit-at = 512k / 4M max-limit = 512k / 4M”. Change both values. “Limit-at = Upload / Download max-limit = Upload / Download“. k = Kilobit, M = Megabit.

When connected with Winbox, go to System> Script menu. Add a new rule with “+” and paste the code. Give it a name you want. (No gap)

DHCP_Script
DHCP_Script

Now go to IP> DHCP Server menu. Click on the DHCP Server segment here. In the window that opens, we press the + button in DHCP and we come to the Script segment in the window that opens. Here we give the name we gave to the Script List section and click OK.

DHCP_Server
DHCP_Server

A new rule will now be added to the Queues List for clients receiving IP. Also, we want to check. It takes and writes the “Hostname” part of the client as a “Comment“.

Queues
Queues

We now know how to do speed stabilization in DHCP based IP distribution.

I hope it was a useful article.