Viewing public address ranges

You can view public address ranges with the console, CLI, API, and Terraform.

Viewing public address ranges in the console

To view public address ranges in the IBM Cloud console, select the Navigation menu Menu icon, then click Infrastructure VPC icon > Network > Public address ranges.

The Public address ranges for VPC page shows the following information:

  • Name: The name of the public address range object.

  • Status: States whether the address range is bound or unbound to the specified VPC.

  • Lifecycle state: States whether the binding or unbinding of the address range is successful, and if it is stable or not.

  • IP range: The range of IP addresses included in the address range.BYOIP (IPv4) Beta

    Public address ranges that were created from a custom authorized CIDR display an icon indicating "Created from an authorized CIDR".

  • Zone: States the zone that the address range is bound to (if applicable).

  • Target resource: States the VPC that the address range is bound to in the previous zone (if applicable).

BYOIP (IPv4) BetaTo view details of a public address range, click the name to open the details page. The details page shows:

  • Name, Resource group, Location, IP range, Size, IP version, VPC, ID, CRN, Created date, and Lifecycle state.
  • Authorized CIDR: If the public address range was created from a custom authorized CIDR, the linked name of the authorized CIDR is displayed. Click the link to navigate to the CIDR details page.

Viewing public address ranges from the CLI

To view public address ranges from the command line, follow these steps:

  1. Set up your CLI environment.

  2. Log in to your CLI environments. After you enter the password, the system prompts which account and region that you want to use:

    ibmcloud login --sso
    
  3. Run the following command:

    ibmcloud is public-address-range PUBLIC_ADDRESS_RANGE [--output JSON] [-q, --quiet]
    

    BYOIP (IPv4) Beta

    ibmcloud is public-address-ranges [--profile-name PROFILE_NAME] [--resource-group-id RESOURCE_GROUP_ID | --resource-group-name RESOURCE_GROUP_NAME | --all-resource-groups] [--output JSON] [-q, --quiet]
    ibmcloud is public-address-range PUBLIC_ADDRESS_RANGE [--output JSON] [-q, --quiet]
    

    Where:

    PUBLIC_ADDRESS_RANGE
    The ID or name of the public address range to view.

    BYOIP (IPv4) Beta

    --profile-name
    Filter the list by profile name. Use this option to view only public address ranges from IBM-managed IP pools or only those from custom authorized CIDRs.
    --resource-group-id
    Filter by resource group ID. Mutually exclusive with --resource-group-name.
    --resource-group-name
    Filter by resource group name. Mutually exclusive with --resource-group-id.
    --all-resource-groups
    Query all resource groups.
    --output
    The output format, only JSON is supported. One of: JSON.
    -q, --quiet
    Suppress verbose output.

Command examples

View the public address range $par-id:

ibmcloud is public-address-range $par-id

View all public address ranges:

ibmcloud is public-address-ranges

BYOIP (IPv4) BetaFilter public address ranges by profile name:

ibmcloud is public-address-ranges --profile-name provider-ipv4

Viewing public address ranges with the API

Before you begin, set up your API environment.

Select one of the following options:

  • View all public address ranges for an account:

    curl -sX GET \
             "$vpc_api_endpoint/v1/public_address_ranges?version=$api_version&generation=2" \
             -H "Authorization: Bearer $iam_token"
    

BYOIP (IPv4) Beta

  • Filter by profile name to view only custom authorized CIDR-based ranges:

    curl -sX GET \
             "$vpc_api_endpoint/v1/public_address_ranges?version=$api_version&generation=2&profile.name=public-address-range-user-ipv4" \
             -H "Authorization: Bearer $iam_token"
    
  • View a specific public address range:

    curl -sX GET \
             "$vpc_api_endpoint/v1/public_address_ranges/$par_id?version=$api_version&generation=2" \
             -H "Authorization: Bearer $iam_token"
    

Viewing public address ranges with Terraform

To view a public address range with Terraform, use the following example:


data "ibm_is_public_address_range" "public_address_range_instance" {
  name = "example-public-address-range"
}
data "ibm_is_public_address_range" "public_address_range_instance1" {
  # name = "example-public-address-range"
  identifier =  ibm_is_public_address_range.public_address_range_instance.id
}

To get a list of public address ranges:

data "ibm_is_public_address_ranges" "public_address_range_instances_example_testing" {
}

Next steps