All Products
Search
Document Center

Elastic Compute Service:Static public IP address

Last Updated:Jan 10, 2025

Assign a static public IP address to an Elastic Compute Service (ECS) instance to enable the ECS instance to communicate over the Internet. This topic describes the procedures for assigning, changing, releasing, and revoking a static public IP address for an ECS instance.

Assign a static public IP address

For an ECS instance deployed in the China (Hong Kong) region assigned with a public IP address, choose a proper line type to reduce network latency

BGP (Multi-ISP) is suitable for instance communication within the China (Hong Kong) region and between the China (Hong Kong) region and other regions outside the Chinese mainland over the Internet. When you connect instances in the China (Hong Kong) region with instances in Chinese mainland regions, international Internet service provider (ISP) services are used. To reduce network latency during this process, choose BGP (Multi-ISP) Pro.

image

Pay for a static public IP address

  • Accessing the Internet using a static public IP address, you are not charged for resource retention fees but charged for outbound bandwidth fees over the Internet.

  • The billing methods of a static public IP address include Pay-by-bandwidth and Pay-by-traffic. For detailed billing information, see Public bandwidth.

Change the static public IP address

More than six hours after an instance is created

If more than six hours have passed since an ECS instance is created, the static public IP address cannot be directly changed. Instead, you must reassign a static public IP address to your ECS instance using the following method:

Within six hours after an instance is created

You can use the Change Public IP button in the console.

Prerequisites

  • You ECS instance is in the Stopped state.

    Note

    If you use a pay-as-you-go, internal-facing ECS instance, you must stop your ECS instance in standard mode. If you stop the ECS instance in Economical mode, the static public IP address of the ECS instance cannot be changed. For more information, see Economical mode.

  • The number of IP address changes for an ECS instance cannot exceed three.

    Note

    If you need to change the public IP address of your ECS instance more than three times, see the More than six hours after an instance is created tab.

Sample procedure

  1. Log on to the ECS console.

  2. In the left-side navigation pane, choose Instances & Images > Instances.

  3. In the top navigation bar, select the region and resource group to which the resource belongs. 地域

  4. Find the ECS instance for which you want to change the public IP address. In the Actions column, choose icon1 > Network and Security Group > Change Public IP Address.

  5. In the Change Public IP Address dialog box, check the information and click Confirm.

    Upon a successful change, the dialog box displays the new static public IP address assigned to your ECS instance.

Release and revoke a static public IP address

Upon the release of an ECS instance, the static public IP address of the ECS instance is revoked and cannot be retained. In addition, the static public IP address of an ECS instance may also be revoked or reassigned in the following scenarios:

Note

If you want more than one ECS instances to use the same public IP address, or retain a public IPv4 address of an ECS instance after the ECS instance is released, we recommend that you use an Elastic IP address (EIP). An EIP enables more flexible operations than a static public IP address, supporting association or disassociation with ECS instances. For more information, see Convert the public IP address of an ECS instance in a VPC to an EIP.

FAQs

  1. Question 1: If I encounter high network latency when I access an ECS instance deployed in a region outside Chinese mainland from a place within Chinese mainland, can I resolve the issue by changing the static public IP address?

    Answer: No, the issue can hardly be resolved.

    When you access an ECS instance deployed in a region outside Chinese mainland from a place within Chinese Mainland, requests travel through international-facing routing nodes provided by your ISP, possibly suffer from international data link congestion, and may be restricted by regulations on international-facing routing mechanisms. Therefore, you may inevitably experience unstable network connections.

    • We recommend that you deploy your ECS instance in a region within Chinese mainland.

    • Alternatively, you can leverage Global Accelerator. For more information, see What is Global Accelerator?

  2. Question 2: Can I specify an IP address to assign it to my ECS instance or change the current static public IP address to it?

    Answer: No, the IP address cannot be specified.

    The static public IP address can only be assigned by the system. Specifying an IP address is not supported.