Remove reserved leases from the same device

There is a device on our network that requests dhcp leases frequently with a new mac address
resulting in a big list of reserved leases from the same android machine.

My idea is to search for the mac address that starts with xx:xx:xx because it is unique to our network but always
the same for that device.

And then deleting all the reserved leases from it every hour or so.

I just need to add some code to the script below to only delete leases with starting mac of xx:xx:xx

/system scheduler
add interval=1d name=delete-dhcp-leases on-event="/ip dhcp-server lease remove [find dynamic]" policy=read,write start-date=jun/02/2017 start-time=00:00:00

Can anyone help?

You could use something like this:

/ip dhcp-server lease remove [find dynamic and mac-address~“^DA:A1:19:”]

Thank you, I tried testing it in a terminal first before scheduling it, but it doesnt show the lease.
Might i be doing something wrong? I used the command below :

[rb951@MikroTik] /ip dhcp-server lease> :put [find mac-address~"^60:01:94"]        
*756;*757

It works but it does not print the lease details but the lease numbers when you use it that way.
Those numbers are OK as a parameter to “remove”.

/ip dhcp-server lease print where mac-address~“^60:01:94”

:slight_smile: