remove_dhcp_lease
Deletes a DHCP lease by IP or MAC address to force a client to renew its IP; preview first, then confirm, with a warning for static leases.
Instructions
Remove a DHCP lease (/ip/dhcp-server/lease remove) by address
or mac_address - typically to force a client to renew its IP. At
least one of address/mac_address must be given and must match an
existing lease (mac_address is tried first if both are given).
Removes EITHER a dynamic or a static lease. If the resolved lease
is STATIC (dynamic=false - i.e. it was pinned with
add_static_dhcp_lease), the returned preview's warning field is
non-null: removing it deletes the pinned IP<->MAC mapping itself,
not just a renewable cache entry. Always check warning before
calling again with confirm=true. No warning for a dynamic lease -
that is this tool's ordinary use case.
WRITE tool, guarded: blocked entirely unless the server is running
with MIKROTIK_ALLOW_WRITE=true. Call with confirm=False (the
default) to get a preview (including the warning field) without
changing anything; call again with confirm=True to actually remove
it. Errors clearly if nothing matches.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| address | No | ||
| confirm | No | ||
| device_name | Yes | ||
| mac_address | No |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
No arguments | |||