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
| 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 |
|
Scenario 1: Unbinding an EIP from an ECS and Binding a New EIP to the ECS
- Unbind an EIP.
- Go to the EIP list page.
- 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.
- Click Yes in the displayed dialog box.
In the EIP list, the target EIP has no associated instance.
- Assign an EIP.
If you already have an EIP that you require, skip this step.
- Go to the EIP list page.
- On the displayed page, click Buy EIP.
- Configure parameters as prompted.
- Click Next.
- Bind the new EIP to the ECS.
- Go to the EIP list page.
- On the EIPs page, locate the target EIP, and click Bind in the Operation column.
- Select the desired ECS.
- Click OK.
- Release the EIP that is unbound.
If an unbound EIP is no longer required, you can release it.
- Go to the EIP list page.
- 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.
- Confirm the information and click OK.
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
- Assign an EIP by referring to 2.
If you already have an EIP that you require, skip this step.
- Unbind an EIP from a load balancer and bind the new EIP to the load balancer.
- Go to the load balancer list page.
- On the displayed page, locate the row that contains the load balancer and click More in the Operation column.
- Unbinding an IPv4 EIP
- Click Unbind IPv4 EIP.
- In the displayed dialog box, confirm the IPv4 EIP that you want to unbind and click OK.
- Binding an IPv4 EIP
- Click Bind IPv4 EIP.
- In the Bind IPv4 EIP dialog box, select the EIP you want to bind to the load balancer and click OK.
- Unbinding an IPv4 EIP
- Release the EIP that was replaced. For details, see 4.
If an unbound EIP is no longer required, you can release it.
Scenario 3: Unbinding an EIP from a NAT Gateway and Binding a New EIP to the NAT Gateway
- Assign an EIP by referring to 2.
If you already have an EIP that you require, skip this step.
- Modify an SNAT rule.
For details, see Modifying an SNAT Rule. In the EIP list, select the new EIP and deselect the existing EIP.
- Modify a DNAT rule.
For details, see Modifying a DNAT Rule. Select the newly assigned EIP.
- Release the EIP that was replaced. For details, see 4.
If an unbound EIP is no longer required, you can release it.