IP address management FAQ

Updated at:

Get and query IP addresses

Change IP addresses

IP protocols and other topics

Appendix

Are public and private IP addresses independent? Can I specify or add IP addresses?

Public IP addresses map to private IP addresses using NAT. You can specify secondary private IP addresses or add IP addresses using multiple IP configurations.

How do I replace an instance's static public IP with another EIP?

If you selected fixed bandwidth when purchasing your Elastic Compute Service instance and have already purchased a new EIP, follow these steps:

What are the limits for transferring an ECS instance and changing its public IP address?

Transferring an ECS instance and changing its public IP address are subject to the following limits:

  • Public IPs and EIPs cannot be transferred across accounts.

  • If an instance has no public IP assigned, you can bind an EIP to it. Bind a new EIP to change the public IP.

  • If an instance already has a public IP assigned:

How do I query the IP address of an ECS instance?

  • Linux instances

    Use ifconfig to view NIC information. You can see the IP address, subnet mask, gateway, DNS, MAC address, and other details.

  • Windows instances

    In a command window, use ipconfig /all to view NIC information. You can see the IP address, subnet mask, gateway, DNS, MAC address, and other details.

For more information, see IP addresses.

How do I disable the public network interface of an ECS instance?

  • Linux instances

    1. Use ifconfig to check the NIC name of the ECS instance.

    2. Use ifdown to disable the NIC. If the NIC name is eth1, run ifdown eth1.

      Note

      You can also use the ifup command to re-enable the NIC. If the NIC name is eth1, run ifup eth1.

  • Windows instances

    1. In a command window, use ipconfig to view NIC information.

    2. Open and disable the NIC.

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 creating an instance?

You can change the public IP address within six hours after instance creation. For detailed steps, see Change public IP address.

After six hours, the options depend on the instance's network type.

You can convert the public IP to an EIP. For detailed steps, see Convert static public IP to EIP.

Why don't I see the option to change the public IP in the ECS console?

  • Within six hours after instance creation: You can directly Change Public IP Address in the console.

  • More than six hours after instance creation: Changing the public IP address directly is not supported, so the Change Public IP Address option does not appear.

For more information, see Static public IP.

Besides changing the public IP address, can I also change the private IP address?

Yes. For detailed steps, see Primary private IP address.

If no public IPv4 address was assigned when creating an instance, how can I obtain a public IP address after the instance is created?

How do I view resource quotas?

To view usage limits and quotas for resources, see Limits.

How do I block access from specific regions or outside China?

ECS security groups support access control rules based only on IP addresses or CIDR blocks, not by geographic region. To block access by region, choose one of the following solutions based on your service type:

Can I detach the primary ENI of an ECS instance and attach it to another ECS instance?

You cannot detach the primary ENI of an ECS instance and attach it to another instance without releasing the original instance.

To assign the primary ENI's private IP to another ECS instance without releasing the original instance, follow these steps:

  1. Stop the source instance that holds the private IP.

  2. Change the private IP of the source instance's primary ENI to another unused IP in the same CIDR block to release the original IP.

  3. Stop the destination instance.

  4. Set the private IP of the destination instance's primary ENI to the original instance's private IP.

Releasing an ECS instance deletes its associated ENIs by default. You can choose to retain ENIs when releasing an instance and attach them to a new instance. For more information, see Retain ENIs when releasing an instance.