After a NAT gateway is created, you can add DNAT rules to allow servers in your VPC to provide services accessible from the Internet.
You can configure only one DNAT rule for each port of a server. One port can be mapped to only one EIP. If multiple servers need to provide services accessible from the Internet, create multiple DNAT rules.
A NAT gateway has been created.
in the upper left corner and select the desired region and project.
Add security group rules to allow inbound or outbound traffic after you add a DNAT rule. Otherwise, the DNAT rule does not take effect.

Parameter |
Description |
|---|---|
Scenario |
VPC: Servers in the VPC can share an EIP to provide services accessible from the Internet through the DNAT rule. Direct Connect: Servers in your data center that are connected to a VPC using Direct Connect or VPN can provide services accessible from the Internet through the DNAT rule. |
Port Type |
The port type. You can select All ports or Specific port.
|
Protocol |
The protocol can be TCP or UDP. This parameter is available if you select Specific port for Port Type. If you select All ports, the value of this parameter will be All by default. |
EIP |
The EIP that will be used by the server to provide services accessible from the Internet. You can select an EIP that either is not bound to any resource, has been bound to a DNAT rule with Port Type set to Specific port of the current NAT gateway, or has been bound to an SNAT rule of the current NAT gateway. |
Outside Port |
The port of the EIP. This parameter is available if you select Specific port for Port Type. Value range: 1–65535 You can enter a single port number, for example, 80. |
Private IP Address |
|
Inside Port |
The port of the server that provides services accessible from the Internet through the DNAT rule. This parameter is available if you select Specific port for Port Type. Value range: 1–65535 You can enter a single port number, for example, 80. |