nat.php¶
Static NAT management module: adding and removing IP address forwarding rules via MikroTik.
API Methods¶
| Method | Action | Description |
|---|---|---|
add_static_nat | add static NAT | Creates a static NAT passthrough via Microtic for the specified server with ACL and TTL support. |
remove_static_nat | remove static NAT | Removes the static NAT passthrough for the specified server or white IP. |
nat/add_static_nat¶
Creates a static NAT passthrough via Microtic for the specified server with ACL and TTL support.
HTTP Method: POST
Parameters:
| Parameter | Required | Type | Description |
|---|---|---|---|
| action | ✅ | string | Method identifier: add_static_nat |
| token | ✅ | string | Authorization token |
| id | ✅ | integer | Server ID |
| ip_acl | ❌ | string | IP ACL (IP/mask format) |
| secured | ❌ | integer | Secure connection flag (0 or 1) |
| ttl | ❌ | integer | TTL (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 for rule removal |
Example Request
Example of a successful response
Failure response
```json { "code": -1, "message": "NAT/remove_static_nat: invalid server id" }