dhcp
Manage DHCP leases, static reservations, ranges, options, and per-subnet DNS on OPNsense. Create, list, update, move, or delete records and apply changes now or staged.
Instructions
DHCP: leases, static reservations, ranges, options and per-subnet DNS. Call action='help' for each action's fields and rules.
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": {
"action": "<action>"
},
"name": "dhcp"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| ip | No | [delete_lease] IP address to delete | |
| mac | No | [create_host, delete_lease] MAC address (e.g. 'aa:bb:cc:dd:ee:ff') | |
| tag | No | [set_router] Tag uuid to scope to instead of an interface | |
| host | No | [delete_host, move_host] Hostname, MAC, or reservation uuid to delete | |
| ipv4 | No | [create_host, move_host] IPv4 address to assign (e.g. '172.20.8.50') | |
| ipv6 | No | [create_host, move_host] IPv6 suffix: integer (e.g. 50 → ::50) or '::abcd' | |
| slot | No | [set_dns] Optional slot index (1 or 2) for single-address updates | |
| uuid | No | Record to act on, identified by a list action. | |
| apply | No | Apply now rather than leaving the change staged. The default differs by action; action='help' reports each one. | |
| descr | No | [create_host, list_hosts] Optional description | |
| force | No | [set_router] Send the option even when the client did not ask | |
| action | Yes | Operation to run. 'help' lists fields. | |
| domain | No | [create_host, create_range, update_range] Optional domain for the host (e.g. 'lan') | |
| family | No | [set_dns] Address family to update: ipv4 or ipv6 | |
| router | No | [set_router] Gateway address to advertise | |
| search | No | [leases, list_hosts] Filter leases by hostname, IP, or MAC address. Omit for full table. | |
| subnet | No | [list_dns, set_dns, toggle_range] Subnet in CIDR notation (e.g. 172.20.2.0/24) | |
| confirm | No | Token returned by the previous call, to confirm. | |
| enabled | No | Target state, set explicitly rather than flipped. | |
| end_addr | No | [create_range, update_range] Last address | |
| hostname | No | [create_host, delete_lease] Hostname for the reservation (e.g. 'mydevice') | |
| client_id | No | [create_host, move_host] Optional DHCP client identifier / DUID for IPv6 (e.g. '52:54:00:7e:9c:f4:00:ab:cd:01'). Accepts optional 'id:' prefix. | |
| interface | No | [create_range, list_dns, set_dns, set_router, toggle_range] Interface key, e.g. opt3 | |
| dns_server | No | [set_dns] Single DNS server address | |
| lease_time | No | [create_range, update_range] Seconds, or a suffixed value like 2h | |
| start_addr | No | [create_range, update_range] First address | |
| description | No | Free-text note stored on the record. | |
| dns_servers | No | [set_dns] One or two DNS server addresses | |
| subnet_mask | No | [create_range, update_range] subnet_mask | |
| missing_ipv6 | No | [list_hosts] When true, return only reservations with IPv4 but no ::N IPv6 suffix | |
| new_hostname | No | [move_host] New dnsmasq host reservation name (optional rename) |