Updated on 2025-08-26 GMT+08:00

Changing an EIP for an Instance

Scenarios

If you want to change an EIP for an ECS, a load balancer, a NAT gateway, or other cloud resources, you need to unbind the current EIP from the cloud resource first. Then, you can bind a new EIP to the cloud resource to enable Internet access for it.

Changing an EIP for a Cloud Resource

Figure 1 Process description
Table 1 Process description

No.

Procedure

Description

1

Unbind an EIP

After an EIP is unbound from a cloud resource, the cloud resource can have a new EIP bound for Internet access.

2

Assign a new EIP

If you already have an EIP that you require, skip this step.

3

Bind a new EIP

After a cloud resource has a new EIP bound, it can access the Internet using the new EIP.

4

Release the EIP that has been unbound

  • If an unbound EIP still needs to be used, skip this step.
  • If an unbound EIP is no longer required, you can release it. If you do not release an unbound EIP, it will continue to be billed.

Scenario 1: Unbinding an EIP from an ECS and Binding a New EIP to the ECS

  1. Unbind an EIP.
    1. Go to the EIP list page.
    2. On the displayed page, locate the row that contains the target EIP, and click Unbind in the Operation column.

      A confirmation dialog box is displayed.

    3. Click Yes in the displayed dialog box.

      In the EIP list, the target EIP has no associated instance.

  2. Assign an EIP.

    If you already have an EIP that you require, skip this step.

    1. Go to the EIP list page.
    2. On the displayed page, click Buy EIP.
    3. Configure parameters as prompted.
    4. Click Next.
  3. Bind the new EIP to the ECS.
    1. Go to the EIP list page.
    2. On the EIPs page, locate the target EIP, and click Bind in the Operation column.
    3. Select the desired ECS.
    4. Click OK.
  4. Release the EIP that is unbound.

    If an unbound EIP is no longer required, you can release it. If you do not release an unbound EIP, it will continue to be billed.

    1. Go to the EIP list page.
    2. In the EIP list, locate the row that contains the EIP and choose More > Release in the Operation column.

      A confirmation dialog box is displayed.

    3. Click Yes in the displayed dialog box.

      You can find that the EIP is not in the EIP list.

Scenario 2: Unbinding an EIP from a Load Balancer and Binding a New EIP to the Load Balancer

  1. Assign an EIP by referring to 2.

    If you already have an EIP that you require, skip this step.

  2. Unbind an EIP from a load balancer and bind the new EIP to the load balancer.
    1. Go to the load balancer list page.
    2. On the displayed page, locate the row that contains the load balancer and click More in the Operation column.
      1. Unbinding an IPv4 EIP
        1. Click Unbind IPv4 EIP.
        2. In the displayed dialog box, confirm the IPv4 EIP that you want to unbind and click OK.
      2. Binding an IPv4 EIP
        1. Click Bind IPv4 EIP.
        2. In the Bind IPv4 EIP dialog box, select the EIP you want to bind to the load balancer and click OK.
  3. Release the EIP that was replaced. For details, see 4.

    If an unbound EIP is no longer required, you can release it. If you do not release an unbound EIP, it will continue to be billed.

Scenario 3: Unbinding an EIP from a NAT Gateway and Binding a New EIP to the NAT Gateway

  1. Assign an EIP by referring to 2.

    If you already have an EIP that you require, skip this step.

  2. Modify an SNAT rule.

    For details, see Modifying an SNAT Rule. In the EIP list, select the new EIP and deselect the existing EIP.

  3. Modify a DNAT rule.

    For details, see Modifying a DNAT Rule. Select the newly assigned EIP.

  4. Release the EIP that was replaced. For details, see 4.

    If an unbound EIP is no longer required, you can release it. If you do not release an unbound EIP, it will continue to be billed.