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.

  • 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.

  • ResponseContext: Information about the context of the response.

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

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 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-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.

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.