MikroTik API icon

MikroTik API

Community Node for MikroTik RouterOS API

Actions67

DHCP Server → Get All

AI-generated

Summary

Retrieves all DHCP server configurations from the MikroTik device by executing /ip/dhcp-server/print.

Inputs

  • connectionAttempts — Number of times to try connecting to the device before giving up. The node will retry the connection this many times, waiting 'connectionDelay' seconds between attempts (default: 5).
  • connectionDelay — Delay in seconds between connection attempts (default: 3).
  • cleanKeys — When true, replaces hyphens (-) and forward slashes (/) in the returned property names with underscores (e.g., 'address-pool' becomes 'address_pool'). This makes the keys easier to reference in expressions (default: false).
  • tag — A custom tag (numeric) that is added to the command sent to the RouterOS device. Useful for debugging or correlating responses (default: 0).

Output shape

An array with a single item containing an object with the following properties:

The node follows the standard output structure: each execution result is wrapped in an array, and each result contains a 'json' field with the data described below. The description here refers to the contents of that 'json' field.

Examples

Example 1: List all DHCP servers on a MikroTik router.

Set Resource to 'DHCP Server' and Operation to 'Get All'. Leave the optional options at their defaults unless you need to adjust retry behavior or key formatting.

Links

Discussion