opn_update_nat_rule
Update an existing NAT port forwarding rule by UUID, changing only the specified parameters such as target IP, port, or protocol while preserving all other settings.
Instructions
Update an existing NAT port forwarding rule by UUID with savepoint protection where supported.
Use this when you need to change the target IP, port, or other properties of a NAT rule. Only the parameters you provide are changed; all other settings are preserved.
Savepoint protection applies on OPNsense < 26.7 only: there changes auto-revert in 60 seconds unless confirmed with opn_confirm_changes. OPNsense 26.7 removed the savepoint API upstream, so on 26.7+ changes apply immediately and are NOT rolled back automatically. Check opn_mcp_info first: if 'savepoint_support' is false, take a config backup with opn_download_config before changing rules that could lock you out. Use opn_list_nat_rules first to find the UUID.
Parameters:
uuid: NAT rule UUID (from opn_list_nat_rules)
interface: source interface (e.g. 'wan', 'opt1')
protocol: 'TCP', 'UDP', or 'TCP/UDP'
destination_port: external port to forward (e.g. '8080', '3000-3010')
target_ip: internal IP address to forward to
target_port: internal port
description: human-readable description
enabled: enable/disable the rule
Returns: dict with 'revision' (str), 'uuid' (str), and 'result' (str).
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| uuid | Yes | ||
| enabled | No | ||
| protocol | No | ||
| interface | No | ||
| target_ip | No | ||
| description | No | ||
| target_port | No | ||
| destination_port | No |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
No arguments | |||