An elastic IP address (EIP) is a public IP address that you can purchase and use as an independent resource. You can create an EIP and associate it with an Elastic Compute Service (ECS) instance in a virtual private cloud (VPC) that has no public IP addresses to make the instance accessible to the Internet.

Prerequisites

To associate an EIP with an instance, make sure that the instance meets the following requirements:
  • The instance resides within a VPC.
  • The instance resides within the same region as the EIP.
  • The instance is in the Running or Stopped state.
  • No public IP addresses are associated with the primary network interface controller (NIC) of the instance.

Associate an EIP with an instance

  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 a region.
  4. Find the instance with which you want to associate an EIP and click More > Network and Security Group > Associate EIP in the Actions column.
  5. In the Associate EIP dialog box, select an EIP from the EIP drop-down list.
    If no EIPs are available, click Create EIP on the right side of the EIP drop-down list to create an EIP. For more information, see Apply for an EIP.
  6. Click OK.
    After the EIP is associated with the instance, the EIP is displayed in the IP Address column corresponding to the instance on the Instances page. Example: 192.168.XX.XX (EIP).

Disassociate an EIP from an instance

  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 a region.
  4. Find the instance from which you want to disassociate an EIP and click More > Network and Security Group > Disassociate EIP in the Actions column.
  5. In the Disassociate EIP message, confirm the message.
  6. Click OK.
    After the EIP is disassociated from the instance, the EIP is not displayed in the IP Address column corresponding to the instance on the Instances page.
    Note
    • After an EIP is disassociated from an instance, you are still charged for the EIP. If you no longer need the EIP, manually release it. For more information, see Release a pay-as-you-go EIP.
    • After an EIP is disassociated from an instance, the instance cannot use the EIP to access the Internet.