Updated on 2024-03-30 GMT+08:00

Step 4: Test the Connection

Scenarios

After adding a DNAT rule, you can perform the following steps to verify the connection:

  1. Verify that the DNAT rule has been added for the public NAT gateway.
  2. Check whether ECS 01 in the private network can be accessed by ECS 02 from the Internet through the NAT gateway (EIP 120.46.131.153 bound to the DNAT rule).

Prerequisites

A DNAT rule has been added.

Verifying that the DNAT Rule Has Been Added

  1. Log in to the management console.
  2. Click Service List in the upper left corner. Under Network, select NAT Gateway.
  3. On the Public NAT Gateways page, click the name of the public NAT gateway.
  4. In the DNAT Rules tab, view details about the DNAT rule and check whether the DNAT rule has been created.

    If Status of the DNAT rule is Running, the DNAT rule has been created.

Verifying that Servers in a VPC Can Be Accessed from the Internet Through the NAT Gateway

  1. Log in to the management console.
  2. Log in to ECS 02 with an EIP bound.
  3. On ECS 02, ping the EIP (120.46.131.153) to check whether ECS 01 on the private network can be accessed by ECS 02 on the public network through the NAT gateway.

    Figure 1 Verification result

    Figure 2 Failed to be accessed from the Internet