To configure a DHCP server to automatically add clients to a Simple Queue in MikroTik RouterOS, you can use the DHCP server lease script. This script will trigger whenever a DHCP lease is given or renewed and will add the client to a Simple Queue.
Here's a step-by-step guide how to make dhcp-server add to simple queue automatic mikrotik :
1. add the total bandwidth upload and download to simple queue and will automatically be distributed evenly to all connected clients, here example upload 20M and download 30M and 192.168.97.0/24 asume ip address of ether connected to client network
/queue simple add name="Total" target=192.168.97.0/24 parent=none queue=pcq-upload-default/pcq-download-default max-limit=20M/30M
2. Go to ip dhcp-server and double click dhcp-server you have, on script tab, paste code bellow :
:local queParent "Total";
:local queueName "Client- $leaseActMAC";
:if ($leaseBound = "1") do={
/queue simple add name=$queueName target=($leaseActIP . "/32") parent=$queParent max-limit=1M/2M comment=[/ip dhcp-server lease get [find where active-mac-address=$leaseActMAC && active-address=$leaseActIP] host-name];
} else={
/queue simple remove $queueName
}
change your max-limit bandwidth, the example upload 1Mbps and download 2Mbps.

0 Response to "how to make dhcp-server add to simple queue automatic mikrotik"
Post a Comment