DHCP LEASE TO SIMPLE QUEUES AUTOMATICALLY IN MIKROTIK

You can use this script in DHCP, PPPoE, Hotspot and more.


You can be customized as per requirement.

Bandwidth Limit : limit-at=1024k/1024k max-limit=1024k/1024k

IP Block subnet : $leaseActIP . "/32"

Queue Name : KarimZI- $leaseActMAC


1. IP -> DHCP Server -> Script

2. Copy this script and paste in script box

3. Click Apply




#Script

:local queueName "KarimZI- $leaseActMAC";

:if ($leaseBound = "1") do={

    /queue simple add name=$queueName target=($leaseActIP . "/32") limit-at=1024k/1024k max-limit=1024k/1024k comment=[/ip dhcp-server lease get [find where active-mac-address=$leaseActMAC && active-address=$leaseActIP] host-name];

} else={

    /queue simple remove $queueName

}

Comments