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.
Tool call template
Replace each placeholder with a value matching the input schema. Only required parameters are included; add optional parameters as needed.
{
"id": 1,
"jsonrpc": "2.0",
"method": "tools/call",
"params": {
"arguments": {
"device_name": "<device_name>",
"address": "<address>",
"mac_address": "<mac_address>"
},
"name": "add_static_dhcp_lease"
}
}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 | |||