create_port_forward
Create a port-forwarding rule to map an external WAN port to an internal host and port, making LAN services reachable from the internet. Specify name, internal port, forwarding IP, external port, and protocol.
Instructions
Create a port-forwarding rule that opens an external WAN port and maps it to an internal host/port.
Mutating operation: applied immediately and persisted on the UniFi console. Review existing rules with get_port_forwards first; remove with delete_port_forward. Prefer create_firewall_policy for zone-based/stateful filtering.
Args: name: Unique rule identifier used to find/delete the rule later. dst_port: Internal destination port (1-65535) on the target host. fwd_ip: LAN IP of the internal host receiving forwarded traffic. fwd_port: External listening port (1-65535) on the WAN. proto: IP protocol to forward — "tcp", "udp", or "both". enabled: Whether active on creation. Defaults to True. site: Site to operate on. Defaults to "default". device: Optional device name to target a specific console; omit for default.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| name | Yes | Unique rule identifier used to find/delete the rule later. | |
| site | No | Site to operate on. Defaults to "default". | default |
| proto | No | IP protocol to forward — "tcp", "udp", or "both". | tcp_udp |
| device | No | Optional device name to target a specific console; omit for default. | |
| fwd_ip | Yes | LAN IP of the internal host receiving forwarded traffic. | |
| enabled | No | Whether active on creation. Defaults to True. | |
| dst_port | Yes | Internal destination port (1-65535) on the target host. | |
| fwd_port | Yes | External listening port (1-65535) on the WAN. |