Unlinking a Public IP from a VM or a Network Interface

You can unlink an public IP from a virtual machine (VM) or a network interface it is linked with.

To unlink a public IP from a NAT service, you need to delete the NAT service. For more information, see Deleting a NAT Service.

After you unlink it, the public IP is still linked to your account and can be associated again. If you do not need the public IP anymore, you can release it from your account. For more information, see Releasing a Public IP from Your Account.

Unlinking a Public IP from a VM Using Cockpit v2

You can unlink a public IP only if it is one that you had allocated and linked yourself. Otherwise, the VM uses a default public IP which does not belong to your account and which you cannot unlink.

  1. In the VMs dashboard, check the box of the VM whose public IP you want to unlink.
    The VM is selected.

  2. Click IconUnlink Unlink Public IP.
    A confirmation dialog box appears.

  3. Click Unlink.
    The public IP is unlinked from the VM.

Unlinking a Public IP from a VM or a Network Interface Using OSC CLI

The UnlinkPublicIp command disassociates a public IP from the virtual machine (VM) or network interface card (NIC) it is associated with.

To disassociate the public IP from a NAT service, you need to delete the NAT service. For more information, see the DeleteNatService method.

Request sample
$ osc-cli api UnlinkPublicIp --profile "default" \
    --PublicIp "192.0.2.0"

This command contains the following attributes that you need to specify:

  • DryRun: (optional) If true, checks whether you have the required permissions to perform the action.

  • LinkPublicIpId: (optional) The ID representing the association of the public IP with the VM or the NIC. This parameter is required unless you use the PublicIp parameter.

  • PublicIp: (optional) The public IP. This parameter is required unless you use the LinkPublicIpId parameter.

The UnlinkPublicIp command returns the following elements:

  • ResponseContext: Information about the context of the response.

    • RequestId: The ID of the request.

Result sample
{
  "ResponseContext": {
    "RequestId": "0475ca1e-d0c5-441d-712a-da55a4175157"
  }
}

Unlinking a Public IP from a VM or a Network Interface Using oapi-cli

The UnlinkPublicIp command disassociates a public IP from the virtual machine (VM) or network interface card (NIC) it is associated with.

To disassociate the public IP from a NAT service, you need to delete the NAT service. For more information, see the DeleteNatService method.

Request sample
$ oapi-cli --profile "default" UnlinkPublicIp \
    --PublicIp "192.0.2.0"

This command contains the following attributes that you need to specify:

  • DryRun: (optional) If true, checks whether you have the required permissions to perform the action.

  • LinkPublicIpId: (optional) The ID representing the association of the public IP with the VM or the NIC. This parameter is required unless you use the PublicIp parameter.

  • PublicIp: (optional) The public IP. This parameter is required unless you use the LinkPublicIpId parameter.

The UnlinkPublicIp command returns the following elements:

  • ResponseContext: Information about the context of the response.

    • RequestId: The ID of the request.

Result sample
{
  "ResponseContext": {
    "RequestId": "0475ca1e-d0c5-441d-712a-da55a4175157"
  }
}

Disassociating an EIP from an Instance or a Network Interface Using AWS CLI

Before you begin: Install and configure AWS CLI. For more information, see Installing and Configuring AWS CLI.

To disassociate an EIP from an instance, use the disassociate-address command following this syntax:

Request sample
$ aws ec2 disassociate-address \
    --profile YOUR_PROFILE \
    --public-ip 111.1.1.1 \
    --association-id NOT_SPECIFIED \
    --endpoint https://fcu.eu-west-2.outscale.com

This command contains the following attributes that you need to specify:

  • (optional) profile: The named profile you want to use, created when configuring AWS CLI. For more information, see Installing and Configuring AWS CLI.

  • (optional) public-ip: The EIP.

  • (optional) association-id: The ID of the association.

    • In the public Cloud, you need to specify the public-ip attribute.

    • In a VPC, you need to specify the association-id attribute.

  • endpoint: The endpoint corresponding to the Region you want to send the request to. For more information, see Installing and Configuring AWS CLI.

The EIP is disassociated and is available again in your account.

Related Pages

Corresponding API Methods

AWS™ and Amazon Web Services™ are trademarks of Amazon Technologies, Inc or its affiliates in the United States and/or other countries.