add_static_dhcp_lease
Create a static DHCP lease to pin an IP address to a MAC address, giving clients a stable, predictable IP. Preview changes first, then confirm to apply.
Instructions
Create a static DHCP lease (/ip/dhcp-server/lease), pinning
address to mac_address. Useful to give a client a stable,
predictable IP - e.g. before limiting it with set_client_bandwidth.
WRITE tool, guarded: blocked entirely unless the server is running
with MIKROTIK_ALLOW_WRITE=true. Call with confirm=False (the
default) to get a before/after preview without changing anything;
call again with confirm=True to actually apply it. Errors clearly
(without creating anything) if a lease for mac_address already
exists on the device - it never creates a duplicate.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| server | No | ||
| address | Yes | ||
| comment | No | ||
| confirm | No | ||
| device_name | Yes | ||
| mac_address | Yes |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
No arguments | |||