create_port_forward
Creates a port forwarding rule on a UniFi site by mapping an external port to an internal IP and port, enabling remote access to devices on the network.
Instructions
Create a port forwarding rule via the Classic REST API.
host: console name, ID, or composite ID (MAC:numericId format). site: site name or ID.
payload: port forward config. Required fields (validated locally — a missing field
raises ValueError naming it): name, dst_port, fwd, fwd_port. proto is optional
(the controller defaults it, typically 'tcp_udp'). This Classic REST endpoint enforces
no required fields server-side (verified live: it accepts an empty body and silently
creates a broken rule), so the local check is the only guard.
Example: {"enabled": true, "name": "SSH", "pfwd_interface": "wan", "src": "any",
"dst_port": "2222", "fwd": "192.168.1.10", "fwd_port": "22", "proto": "tcp", "log": false}
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| host | Yes | ||
| site | Yes | ||
| payload | Yes |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
No arguments | |||