nat.php¶
Module for managing static NAT: adding and removing IP address forwarding rules via MikroTik.
API Methods¶
| Method | Action | Description |
|---|---|---|
add_static_nat | add static NAT | Adds a static NAT passthrough for the specified server. Accepts the server ID and ACL for IPMI. |
remove_static_nat | remove static NAT | Removes the static NAT passthrough for the specified server or white IP. |
nat/add_static_nat¶
Adds a static NAT passthrough for the specified server. Accepts the server ID and ACL for IPMI.
HTTP Method: POST
Parameters:
| Parameter | Required | Type | Description |
|---|---|---|---|
| action | ✅ | string | Method identifier: add_static_nat |
| token | ✅ | string | Authorization token |
| id | ✅ | int | Server ID (inside params[] or at the top level) |
| ip_acl | ✅ | string | ACL for IPMI in IP/CIDR format (e.g., 192.168.1.1/24) |
| ttl | ❌ | int | Rule lifetime in hours (default 2, max 24) |
Example Request
Example of a successful response
nat/remove_static_nat¶
Removes the static NAT passthrough for the specified server or white IP.
HTTP Method: POST
Parameters:
| Parameter | Required | Type | Description |
|---|---|---|---|
| action | ✅ | string | Method identifier: remove_static_nat |
| token | ✅ | string | Authorization token |
| id | ✅ | int | Server ID |
| white_ip | ❌ | string | White IP to remove the rule for |
Example Request