I looking for a script to detect a DHCP server lease status=“busy” normally they are lease status=“bound”
Then to delete that lease from lease table, rather than reboot the CPE? can I for this to take effect just disable DHCP server and then re-enable?
https://wiki.mikrotik.com/wiki/Scripts is a great place to find such a thing. (also, if you just mean you want to detect them, just go to leases tab in winbox and filter by status is busy.)
But I noticed that entry is empty… Here’s what I’m using to identify and delete them.
:foreach i in=[/ip dhcp-server lease find status=busy] do={
:if ([:len [/ip dhcp-server lease get $i mac-address]] = 0) do={
/ip dhcp-server lease remove $i;
}
}