All Products
Search
Document Center

Elastic Compute Service:Static public IP address

Last Updated:Nov 25, 2024

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

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

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 More than six hours after an instance is created.

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.

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:

  1. Convert the static public IP address of your ECS instance (excluding pay-by-bandwidth subscription instances) to an EIP, which keeps the IP address unchanged.

    For more information, see Convert the public IP address of an ECS instance in a VPC to an EIP.

    Important
    • A subscription ECS instance does not support this operation within 24 hours before an expiration.

    • For pay-by-bandwidth subscription ECS instances, change the billing method to Pay-by-traffic as described in Change from pay-by-bandwidth to pay-by-traffic, then proceed with the conversion.

  2. Disassociate the EIP from the ECS instance.

    For more information, see Disassociate an EIP from a cloud resource.

    Important
    • After disassociating a pay-as-you-go EIP, you are still charged for EIP configuration fees until you release the EIP.

    • After disassociating a subscription EIP, if you no longer need it, you can unsubscribe from the EIP instance. For more information, see Rules for unsubscribing from resources.

  3. Increase the maximum bandwidth above 0 Mbit/s to trigger the system to automatically assign a new public IPv4 address to the ECS instance.

    For more information, see Modify the public bandwidth configurations of an instance associated with an auto-assigned public IP address and Modify the bandwidth configurations of pay-as-you-go instances.

    After the above steps, check the new public IP address by refering to Overview.

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. 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?

    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 Internet service provider (ISP), suffer from international data link congestion, and are restricted by regulations on international-facing ICP routing mechanisms. Therefore, you may inevitably experience unstable network links, high packet loss, and other network issues, even unreachable ECS instances from clients within certain places.

    • If most users of your service or application are within Chinese mainland, we recommend that you deploy your ECS instance in a region also within Chinese mainland, avoiding disadvantages brought by international Internet travel.

    • If you want to enable your users within Chinese mainlan to access an ECS instance deployed in a region outside Chinese mainland, we recommend that you leverage Global Accelerator. For more information, see What is Global Accelerator?

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

    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.