If your instance is assigned a public IP address, you can change the address within six hours after the instance is created, either in the Classic network or in a VPC network.

Limits

Following are the limits to change the public IP address of an ECS instance:

  • The instance must be assigned a public IP address, which means you can view the public IP address in the IP Address column from the Instance List in the ECS console, as displayed in the following figure. 



    Note
    • If the public network IP address is not assigned at the time of creation of the instance, after the instance is created successfully, you can assign the public IP address by upgrading or downgrading the network bandwidth configuration. For more information, see Overview of configuration changes.
    • If the public network IP address is not assigned during the creation of a Pay-As-You-Go instance, after the instance is created successfully, public IP address cannot be assigned. You can only bind an elastic IP (EIP) address.
  • The instance must be in the Stopped status.

  • The instance has been existing for less than six hours.

    Note
    After six hours, for a VPC instance, you can Convert public IP address to EIP address convert the public IP address to an EIP address, but you cannot change the public IP address of an instance in the Classic network.
  • You can change the public IP address of an instance three times.

Prerequisites

Before you change the public IP address of an instance, stop the instance.

Procedure

To change the public IP address, follow these steps:

  1. Log on to the ECS console.
  2. In the left-side navigation pane, click Instances.
  3. Select a region.
  4. Find the instance to change the public IP address. In the Actions column, select More > > Replace public IP.
    Note
    If your instance has been existing for more than six hours, you cannot get the Replace public IP  option in the More drop-down menu.
  5. On the Replace public IP dialog box, click Start to change.

    When a new public IP address shows on the dialog box,



  6. click OK.

Related operations

You can Change the private IP of an ECS instance.