opnsense_nat_source_add
Create an outbound source NAT rule with custom interface, protocol, and translation settings. Explicit confirmation required before activation.
Instructions
Add a new Source NAT (outbound) rule. After adding, call opnsense_nat_apply to activate. DESTRUCTIVE: requires explicit confirmation.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| enabled | No | Rule enabled (default: true) | |
| interface | Yes | Interface name (e.g. 'wan', 'lan', 'opt1') | |
| ipprotocol | No | IP version | |
| protocol | No | Protocol: any/TCP/UDP/TCP/UDP/ICMP/... | |
| source_net | No | Source network (any/CIDR/alias). Default: any | |
| source_not | No | Invert source match | |
| source_port | No | Source port/range | |
| destination_net | No | Destination network. Default: any | |
| destination_not | No | Invert destination match | |
| destination_port | No | Destination port/range | |
| target | No | Translation target: 'wanip' (default), specific IP, or alias | |
| target_port | No | Translation target port | |
| staticnatport | No | Use static source port | |
| nonat | No | If true, exclude this traffic from NAT (no-NAT rule) | |
| log | No | Log packets matching this rule | |
| sequence | No | Rule order (default: 100) | |
| tagged | No | Match a packet tag set by another rule | |
| description | No | Human-readable description | |
| confirm | Yes | Must be true to confirm |