Assign, change, or release a static public IP address. Use an EIP instead for persistent addresses.
Assign a static public IP
Assign a public IP when you create an instance
ECS Console
-
Quick launch:
-
On the ECS - quick launch page, in the Public Bandwidth section, select Assign Public IPv4 Address.
-
Set the billing method:
-
Pay-by-bandwidth: Charged by provisioned bandwidth. Suitable for stable traffic.
-
Pay-by-traffic: Charged by outbound data transfer. Suitable for fluctuating traffic.
-
-
-
Custom launch:
-
On the ECS console - custom launch page, in the Public IP Address section, select Assign Public IPv4 Address.
-
Set the Bandwidth Billing Method:
-
Pay-by-bandwidth/Bandwidth: Charged by provisioned bandwidth. Suitable for stable traffic.
-
Pay-by-traffic/Maximum Bandwidth: Charged by outbound data transfer. Suitable for fluctuating traffic.
-
-
API
Call RunInstances with InternetMaxBandwidthOut set to a value greater than 0 Mbps.
Assign a public IP to an existing instance
ECS Console
-
Go to ECS console - Instances. Click the target instance ID to open its details page.
-
In the All Actions section, select Change Pay-as-you-go Instance Bandwidth or Change Subscription Instance Bandwidth.
-
Set the Bandwidth Billing Method:
-
Pay-by-traffic: Charged by outbound data transfer. Suitable for fluctuating traffic.
-
Pay-by-bandwidth: Charged by provisioned bandwidth. Suitable for stable traffic.
-
-
Set Bandwidth (or Maximum Bandwidth) to a value greater than 0 Mbps. The system assigns a static public IP address to the instance.
API
Call ModifyInstanceSpec with InternetMaxBandwidthOut set to a value greater than 0 Mbps.
Change a static public IP address
If the static public IP address is configured in your applications, whitelists for cloud services (such as databases or cache services), or system configuration files (such as /etc/hosts), update all related configurations after changing the IP address to avoid service disruptions.
Within 6 hours after the instance creation
If you have changed the public IP address more than three times within 6 hours after instance creation, use the method in More than 6 hours after the instance creation.
-
Go to ECS console - Instances. Click the target instance ID to open its details page.
-
In the All Actions section, choose . In the dialog box, select Standard Mode as the stop mode.
If you select economical mode, the public IP address is reclaimed and the change cannot be performed.
-
In the All Actions section, choose .
A dialog box displays the new static public IP address after the change.
More than 6 hours after the instance creation
A static public IP address is bound to its instance. To change it, convert it to an EIP, unbind it, and then assign a new static public IP.
-
This operation is unavailable within 24 hours before a subscription instance expires.
-
For a pay-by-bandwidth instance, change the billing method to pay-by-traffic first.
-
Set the maximum public bandwidth to a value greater than 0 Mbps. The system assigns a new static public IP address.
-
Release the EIP to avoid EIP configuration fees.
Release and reclaim a static public IP address
The system automatically reclaims a static public IP address in the following situations. Reclaimed addresses cannot be recovered.
-
Bandwidth set to 0: The public IP address is reclaimed when bandwidth is set to 0 Mbps.
-
Economical mode stop: For a pay-as-you-go instance, the public IP address is reclaimed if you stop the instance in economical mode.
-
Instance release: The bound public IP address is reclaimed when the instance is released.
Billing
Static public IP addresses incur no holding fees. You pay only for outbound public bandwidth. See Bandwidth billing.
FAQ
Can I resolve high latency when accessing an ECS instance in an overseas region from the Chinese mainland by changing its public IP address?
No. Traffic to overseas instances from the Chinese mainland traverses international carrier routes, which can cause instability due to link congestion and routing limitations. Use an instance in the Chinese mainland or use Global Accelerator.
Can I specify a particular IP address when assigning or changing a static public IP address?
No. The system randomly assigns an available IP address.
References
Use an Elastic IP Address (EIP) for production workloads that require a persistent, manageable IP address.