Getting Information About Your Public IPs

You can get information about the public IPs allocated to your account.

By default, this action returns information about all your public IPs, whether available, associated with a virtual machine (VM) or a network interface, or used for a NAT service. For more information, see About Public IPs, Linking a Public IP with a VM or a Network Interface, or Creating a NAT service.

Information about your public IPs is also available from within the associated VMs themselves. For more information, see Accessing the Metadata and User Data of a VM.

Getting Information About Your Public IPs Using Cockpit v2

See the Public IPs dashboard.

Getting Information About Your Public IPs Using OSC CLI

The ReadPublicIps command lists one or more public IPs allocated to your account.
By default, this action returns information about all your public IPs: available or associated with a virtual machine (VM), a network interface card (NIC) or a NAT service.

Request sample
$ osc-cli api ReadPublicIps --profile "default" \
    --Filters '{
        "PublicIps": ["192.0.2.0"]
      }'
Request sample
$ osc-cli api ReadPublicIps --profile "default" \
    --Filters '{
        "VmIds": ["i-12345678"]
      }'

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.

  • Filters: (optional) One or more filters.

    • LinkPublicIpIds: (optional) The IDs representing the associations of public IPs with VMs or NICs.

    • NicAccountIds: (optional) The account IDs of the owners of the NICs.

    • NicIds: (optional) The IDs of the NICs.

    • Placements: (optional) Whether the public IPs are for use in the public Cloud or in a Net.

    • PrivateIps: (optional) The private IPs associated with the public IPs.

    • PublicIpIds: (optional) The IDs of the public IPs.

    • PublicIps: (optional) The public IPs.

    • TagKeys: (optional) The keys of the tags associated with the public IPs.

    • TagValues: (optional) The values of the tags associated with the public IPs.

    • Tags: (optional) The key/value combination of the tags associated with the public IPs, in the following format: "Filters":{"Tags":["TAGKEY=TAGVALUE"]}.

    • VmIds: (optional) The IDs of the VMs.

  • NextPageToken: (optional) The token to request the next page of results. Each token refers to a specific page.

  • ResultsPerPage: (optional) The maximum number of logs returned in a single response (between 1 and 1000, both included). By default, 100.

The ReadPublicIps command returns the following elements:

  • NextPageToken: The token to request the next page of results. Each token refers to a specific page.

  • PublicIps: Information about one or more public IPs.

    • LinkPublicIpId: (Required in a Net) The ID representing the association of the public IP with the VM or the NIC.

    • NicAccountId: The account ID of the owner of the NIC.

    • NicId: The ID of the NIC the public IP is associated with (if any).

    • PrivateIp: The private IP associated with the public IP.

    • PublicIp: The public IP.

    • PublicIpId: The allocation ID of the public IP.

    • Tags: One or more tags associated with the public IP.

      • Key: The key of the tag, with a minimum of 1 character.

      • Value: The value of the tag, between 0 and 255 characters.

    • VmId: The ID of the VM the public IP is associated with (if any).

  • ResponseContext: Information about the context of the response.

    • RequestId: The ID of the request.

Result sample
{
  "ResponseContext": {
    "RequestId": "0475ca1e-d0c5-441d-712a-da55a4175157"
  },
  "PublicIps": [
    {
      "VmId": "i-12345678",
      "Tags": [],
      "PublicIpId": "eipalloc-12345678",
      "PublicIp": "192.0.2.0",
      "LinkPublicIpId": "eipassoc-12345678",
      "NicAccountId": "123456789012",
      "NicId": "eni-12345678",
      "PrivateIp": "10.0.0.4"
    }
  ]
}

Getting Information About Your Public IPs Using oapi-cli

The ReadPublicIps command lists one or more public IPs allocated to your account.
By default, this action returns information about all your public IPs: available or associated with a virtual machine (VM), a network interface card (NIC) or a NAT service.

Request sample
$ oapi-cli --profile "default" ReadPublicIps \
    --Filters '{
        "PublicIps": ["192.0.2.0"]
      }'
Request sample
$ oapi-cli --profile "default" ReadPublicIps \
    --Filters '{
        "VmIds": ["i-12345678"]
      }'

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.

  • Filters: (optional) One or more filters.

    • LinkPublicIpIds: (optional) The IDs representing the associations of public IPs with VMs or NICs.

    • NicAccountIds: (optional) The account IDs of the owners of the NICs.

    • NicIds: (optional) The IDs of the NICs.

    • Placements: (optional) Whether the public IPs are for use in the public Cloud or in a Net.

    • PrivateIps: (optional) The private IPs associated with the public IPs.

    • PublicIpIds: (optional) The IDs of the public IPs.

    • PublicIps: (optional) The public IPs.

    • TagKeys: (optional) The keys of the tags associated with the public IPs.

    • TagValues: (optional) The values of the tags associated with the public IPs.

    • Tags: (optional) The key/value combination of the tags associated with the public IPs, in the following format: "Filters":{"Tags":["TAGKEY=TAGVALUE"]}.

    • VmIds: (optional) The IDs of the VMs.

  • NextPageToken: (optional) The token to request the next page of results. Each token refers to a specific page.

  • ResultsPerPage: (optional) The maximum number of logs returned in a single response (between 1 and 1000, both included). By default, 100.

The ReadPublicIps command returns the following elements:

  • NextPageToken: The token to request the next page of results. Each token refers to a specific page.

  • PublicIps: Information about one or more public IPs.

    • LinkPublicIpId: (Required in a Net) The ID representing the association of the public IP with the VM or the NIC.

    • NicAccountId: The account ID of the owner of the NIC.

    • NicId: The ID of the NIC the public IP is associated with (if any).

    • PrivateIp: The private IP associated with the public IP.

    • PublicIp: The public IP.

    • PublicIpId: The allocation ID of the public IP.

    • Tags: One or more tags associated with the public IP.

      • Key: The key of the tag, with a minimum of 1 character.

      • Value: The value of the tag, between 0 and 255 characters.

    • VmId: The ID of the VM the public IP is associated with (if any).

  • ResponseContext: Information about the context of the response.

    • RequestId: The ID of the request.

Result sample
{
  "ResponseContext": {
    "RequestId": "0475ca1e-d0c5-441d-712a-da55a4175157"
  },
  "PublicIps": [
    {
      "VmId": "i-12345678",
      "Tags": [],
      "PublicIpId": "eipalloc-12345678",
      "PublicIp": "192.0.2.0",
      "LinkPublicIpId": "eipassoc-12345678",
      "NicAccountId": "123456789012",
      "NicId": "eni-12345678",
      "PrivateIp": "10.0.0.4"
    }
  ]
}

Getting Information About Your EIPs Using AWS CLI

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

To get information about your EIPs, use the describe-addresses command following this syntax:

Request sample
$ aws ec2 describe-addresses \
    --profile YOUR_PROFILE \
    --public-ips 111.1.1.1 \
    --allocation-ids NOT_SPECIFIED \
    --filters Name=X,Values=Y \
    --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-ips: One or more EIPs you want information about.

    You need to specify either public-ips or allocation-ids.

  • (optional) allocation-ids: One or more IDs of allocation.

  • (optional) filters: One or more filters, in the "Name=X,Values=Y" format.

    You can specify several values for a same filter using the "Name=X,Values=Y, Z" format.

    The following filters are available:

    • instance-id: The ID of the instance the EIP is associated with.

      You need to specify either an instance-id or a network-interface-id.

    • network-interface-id: The ID of the network interface the EIP is associated with.

    • network-interface-owner-id: The account ID of the owner of the EIP.

    • public-ip: The EIP.

    • private-ip-address: The private IP of the instance or the primary private IP of the primary network interface associated with the EIP (if a network interface has several private IPs, the EIP is associated either with the primary or a secondary one).

      You can associate your EIP with a secondary private IP of a network interface. If you do not specify any private IP, the EIP is associated with the primary private IP of the primary network interface.

    • allocation-id: The allocation ID of the EIP.

    • association-id: The ID of the association of the EIP with an instance or a network interface.

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

The describe-addresses command returns the following elements:

  • Addresses: Information about one or more EIPs. This element contains the following information:

    • InstanceId: The ID of the instance the EIP is associated with.

    • PublicIp: The EIP.

    • Domain: Whether your EIP is in a VPC or in the public Cloud. This element is for information only.

    • NetworkInterfaceId: The ID of the network interface the EIP is associated with.

    • AssociationId: The ID of the association of the EIP with an instance or a network interface.

    • NetworkInterfaceOwnerId: The account ID of the owner of the EIP.

    • AllocationId: The ID of the allocation.

    • PrivateIpAddress: The private IP of the instance or the network interface associated with the EIP (if a network interface has several private IPs, it is either the primary or a secondary one).

      Even if the EIP is not associated with any resource, the InstanceId, the PublicIp, the Domain and the AllocationId elements are displayed.

Result sample
{
    "Addresses": [
        {
            "InstanceId": "",
            "PublicIp": "222.2.2.2",
            "Domain": "standard",
            "AllocationId": "eipalloc-12345679"
        },
        {
            "Domain": "vpc",
            "InstanceId": "i-1234567890abcdef0",
            "NetworkInterfaceId": "eni-12345678",
            "AssociationId": "eipassoc-12345678",
            "NetworkInterfaceOwnerId": "123456789012",
            "PublicIp": "111.1.1.1",
            "AllocationId": "eipalloc-12345678",
            "PrivateIpAddress": "10.0.0.0"
        }
    ]
}

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.