create_nat_rule
Create SNAT, DNAT, or REFLEXIVE NAT rules on a Tier-1 gateway to translate source or destination IP addresses. Provide gateway ID, rule ID, and network parameters to configure address translation.
Instructions
[WRITE] Create a NAT rule on a Tier-1 gateway's USER NAT section.
Run list_tier1_gateways for tier1_id and list_nat_rules to avoid an id clash ā the same rule_id overwrites. The gateway must have an edge cluster (see create_tier1_gateway) or NAT cannot be realized, and TIER1_NAT advertisement must be set via update_tier1_gateway for the translated address to be reachable from outside. Returns the created rule dict, else {"error", "hint"}. Then confirm with list_nat_rules; delete_nat_rule is the inverse.
Args: tier1_id: Gateway ID, as returned by list_tier1_gateways. rule_id: Unique ID for the NAT rule. action: "SNAT", "DNAT" or "REFLEXIVE" (default "DNAT"). source_network: Source CIDR (required for SNAT). destination_network: Destination CIDR (required for DNAT). translated_network: Translated network/IP (required for all three). target: NSX Manager target from config (default if omitted).
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| action | No | DNAT | |
| target | No | ||
| rule_id | Yes | ||
| tier1_id | Yes | ||
| source_network | No | ||
| translated_network | No | ||
| destination_network | No |