Destination NAT changes the destination address in IP header of a packet. It can also change the destination port in the TCP/UDP headers. The typical usage of this is to redirect incoming packets with a destination of a public address/port to a private IP address/port inside your network.
You can create a rule to either enable or disable destination NAT.
In this example, as packets are received from the app VM, the Tenant2NAT tier-1 router changes the destination IP address of the packets from 172.16.10.10 to 184.108.40.206. Having a public destination IP address enables a destination inside a private network to be contacted from outside of the private network.
- The tier-0 router must have an uplink connected to a VLAN-based logical switch. See Connect a Tier-0 Logical Router to a VLAN Logical Switch for the NSX Edge Uplink in Manager Mode.
- The tier-0 router must have routing (static or BGP) and route redistribution configured on its uplink to the physical architecture. See Configure a Static Route in Manager Mode, Configure BGP on a Tier-0 Logical Router in Manager Mode, and Enable Route Redistribution on the Tier-0 Logical Router in Manager Mode.
- The tier-1 routers must each have an uplink to a tier-0 router configured. Tenant2NAT must be backed by an NSX Edge cluster. See Attach Tier-1 Router to a Tier-0 Router in Manager Mode.
- The tier-1 routers must have downlink ports and route advertisement configured. See Add a Downlink Port on a Tier-1 Logical Router in Manager Mode and Configure Route Advertisement on a Tier-1 Logical Router in Manager Mode.
- The VMs must be attached to the correct logical switches.
Verify that Manager mode is selected in the NSX Manager user interface. See NSX Manager. If you do not see the Policy and Manager mode buttons, see Configure the User Interface Settings.
- With admin privileges, log in to NSX Manager.
- Select .
- Click a tier-1 logical router on which you want to configure NAT.
- Select .
- Click ADD.
- Specify a priority value.
A lower value means a higher precedence for this rule.
- For Action, select DNAT to enable destination NAT, or NO_DNAT to disable destination NAT.
- Select the protocol type.
By default, Any Protocol is selected.
- (Optional) For Source IP, specify an IP address or an IP address range in CIDR format.
If you leave Source IP blank, the NAT applies to all sources outside of the local subnet.
- For Destination IP, specify an IP address or a comma-separated IP address list.
In this example, the destination IP address is 220.127.116.11.
- If Action is DNAT, for Translated IP, specify an IP address or an IP address range in CIDR format.
In this example, the inside/translated IP address is 172.16.10.10.
- (Optional) If Action is DNAT, for Translated Ports, specify the translated ports.
- (Optional) For Applied To, select a router port.
- (Optional) Set the status of the rule.
The rule is enabled by default.
- (Optional) Change the logging status.
Logging is disabled by default.
- (Optional) Change the firewall bypass setting.
The setting is enabled by default.
The new rule is listed under NAT. For example:
What to do next
Configure the tier-1 router to advertise NAT routes.
To advertise the NAT routes upstream from the tier-0 router to the physical architecture, configure the tier-0 router to advertise tier-1 NAT routes.