Set port forwarding rule
set_port_forwardingCreate or update a port forwarding rule on a Keenetic router to expose internal services, targeting a host by MAC or IP with dry-run default.
Instructions
Create or update a port forwarding rule ('ip static'). The target is addressed by MAC: pass to_host as a MAC, or as an IP that belongs to a registered host (it is resolved, and refused if unknown). dry_run is TRUE by default - it returns the payload without sending it. A real write is saved to startup-config and verified by re-reading the tree. Ports serving MCP endpoints are refused in code.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| port | Yes | External port | |
| enable | No | false disables the rule (per-rule flag) | |
| comment | No | Rule comment | |
| dry_run | No | Default true | |
| to_host | Yes | Target MAC, or IP of a registered host | |
| to_port | No | Internal port, if different | |
| end_port | No | End of external port range | |
| protocol | No | tcp (default) or udp | |
| interface | No | WAN interface, default GigabitEthernet1 |