If the ECS instance does not have a system allocated public IP, you can bind an EIP to the ECS instance to access the Internet.
An EIP is a public IP address resource that you can purchase and possess independently. It can be dynamically bound to a VPC ECS instance without restarting the ECS instance. For more information, refer to EIP overview.
Log on to the EIP console.
Click Apply for Elastic IP.
On the purchase page, configure the EIP and click Buy Now.
Go back to the EIP console after completing the purchase, and click Bind next to the target EIP.
In the Bind dialog, select the ECS instance to be bound and click OK.
Note: Ensure the ECS instance is in the Running or Stopped status, and the ECS instance does not have a system allocated public IP or bound with any other EIPs.
After binding an EIP, the ECS instance can access the Internet through the EIP. You can unbind and release the EIP whenever the Internet access is not needed. For more information, see Manage an EIP.