Get and query IPs
How do I view the private gateway IP address of an ECS instance?
Are public and private IP addresses independent? Can I specify or add IP addresses?
Change IPs
Can I change the public IPv4 address after an instance is created?
How do I replace the static public IP address of an instance with another EIP?
Besides changing the public IP address, can I also change the private IP address?
Why can't I see the option to change the public IP address in the ECS console?
What are the limits on transferring an ECS instance and changing its public IP address?
IP protocols and other topics
How do I disable the public network interface card of an ECS instance?
Do all ECS instances support both classic network and VPC configurations?
Appendix
Are public and private IP addresses independent? Can I specify or add IP addresses?
Classic network: Public IP addresses and private IP addresses are independent. Private IP addresses in the classic network are typically used for communication between Elastic Compute Service (ECS) instances, or between ECS instances and Object Storage Service (OSS) or ApsaraDB RDS. An ECS instance with 0 Mbps of bandwidth is not assigned a public IP address. The IP addresses do not change during normal use. You cannot specify, select, or purchase additional IP addresses.
Virtual Private Cloud (VPC): Public IP addresses are mapped to private IP addresses in Network Address Translation (NAT) mode. You can specify secondary private IP addresses or add more IP addresses.
How do I replace the static public IP address of an instance with another EIP?
If you selected a fixed bandwidth when you purchased the ECS instance and have already purchased a new Elastic IP Address (EIP), perform the following steps:
Method 1:
Convert the fixed bandwidth to pay-as-you-go bandwidth. For more information, see Public bandwidth billing.
Convert the static public IP address to an EIP. For more information, see Convert a static public IP address of a VPC-type ECS instance to an EIP.
Detach the converted EIP. For more information, see Detach an EIP.
Attach the new EIP. For more information, see Associate with an ECS instance.
Method 2:
In the OOS console, use the
ACS-ECS-ConvertsPublicIPToNewEIPByInstanceIdO&M template to convert the public IP address of an instance to another EIP. For the China (Hangzhou) region, visit ACS-ECS-ConvertsPublicIPToNewEIPByInstanceId. After you click the link, you can change the region in the menu bar at the top of the OOS console.
What are the limits on transferring an ECS instance and changing its public IP address?
The following limits apply to transferring an ECS instance and changing its public IP address:
Classic network:
Transferring public IP addresses across accounts is not supported.
Within six hours of instance creation, you can change its public IP address up to three times. After six hours, you can no longer change the public IP address. For more information, see Change a public IP address.
VPC:
Transferring public IP addresses and EIPs across accounts is not supported.
If the instance is not assigned a public IP address, you can attach an EIP to it. You can change the public IP address by attaching a new EIP.
If the instance is already assigned a public IP address:
Within six hours of instance creation, you can change its public IP address up to three times. For more information, see Change a public IP address.
You can change the IP address by converting the public IP address to an EIP. For more information, see Convert a static public IP address to an EIP.
How do I query the IP address of an ECS instance?
Linux instances:
Run the
ifconfigcommand to view network interface card information. You can view information such as the IP address, subnet mask, gateway, DNS, and MAC address.Windows instances:
In the command window, run the
ipconfig /allcommand to view network interface card information. You can view information such as the IP address, subnet mask, gateway, DNS, and MAC address.
For more information, see IP addresses.
How do I disable the public network interface card of an ECS instance?
Linux instances:
Run the
ifconfigcommand to view the name of the ECS instance network interface card.Run the
ifdowncommand to disable the network interface card. For example, if the name of the network interface card iseth1, runifdown eth1.NoteYou can also run the ifup command to enable the network interface card. For example, if the name of the network interface card is
eth1, runifup eth1.
Windows instances:
In the command window, run the
ipconfigcommand to view network interface card information.Open , and disable the network interface card.
How do I configure an IPv6 address for an ECS instance?
For more information, see IPv6 communication.
Can I change the public IPv4 address after an instance is created?
You can change the public IP address within six hours of instance creation. For more information, see Change a public IP address.
After six hours, the procedure varies based on the network type of the instance.
VPC-type ECS instances: You can convert a public IP address to an EIP. For more information, see Convert a static public IP address to an EIP.
Classic network-type ECS instances: This operation is not supported. However, you can convert the public IP address to an EIP when you release the instance. For more information, see Convert a static public IP address of a classic network-type ECS instance to an EIP.
Why can't I see the option to change the public IP address in the ECS console?
Within six hours of instance creation: You can click Change Public IP in the console.
After six hours from instance creation: You cannot directly change the public IP address. Therefore, the Change Public IP option is not available.
For more information, see Static public IP addresses.
Besides changing the public IP address, can I also change the private IP address?
VPC-type ECS instances: Yes, you can. For more information, see Primary private IP address.
Classic network-type ECS instances: No, you cannot.
If I did not assign a public IPv4 address when creating an instance, how can I obtain a public IP address after the instance is created?
You can request and attach an EIP. For more information, see Request an EIP.
You can change the public bandwidth of the instance to assign a static public IP address. For more information about subscription instances, see Overview of instance upgrade or downgrade. For more information about pay-as-you-go instances, see Modify the bandwidth of a pay-as-you-go instance.
Do all ECS instances support both classic network and VPC configurations?
If you purchased an ECS instance for the first time after 17:00 (UTC+8) on June 14, 2017, you cannot select the classic network.
Can the network type of an ECS instance be changed?
ECS instances can only be migrated from the classic network to a VPC. For more information, see Migrate an ECS instance from the classic network to a VPC.
After an instance is migrated from the classic network to a VPC, it cannot be migrated back to the classic network. Before you perform the migration, ensure that you understand this limitation and have completed your network planning.
How do I view resource quotas?
To view resource usage limits and quotas, see Limits.