IBM Cloud Docs
Binding and unbinding a reserved IP address

Binding and unbinding a reserved IP address

You can bind and unbind a reserved IP address to an endpoint gateway by using the UI, CLI, and API.

Binding and unbinding a reserved IP address in the UI

You can bind or unbind a reserved IP address to an endpoint gateway by using the UI.

Binding a reserved IP address

To reserve or bind an IP address by using the IBM Cloud® console:

  1. From the IBM Cloud console, select the Navigation Menu menu icon, then click Infrastructure > Network > Virtual private endpoint gateways. The Virtual private endpoint gateways for VPC page appears.

  2. Highlight the row of the gateway in the table, then click Reserve or bind IP from the Actions menu Actions menu. Alternatively, you can click the gateway name and access this link from the endpoint gateway's details page.

    If you did not reserve or bind an IP during endpoint gateway creation, this link appears in the IP address column in the table.

  3. From the Reserved IP side panel, have IBM select an IP address for you from the subnet that is listed, or select from existing IPs.

    You can bind only one reserved IP to one endpoint gateway from each zone. To bind a reserved IP to an endpoint gateway, you must have an existing subnet. You need to also make sure that no subnets of the VPC that are bound to the same zone.

  4. Specify whether you want to automatically delete the reserved IP if the endpoint gateway is deleted. Then, click Reserve IP address to bind the address to this endpoint gateway.

Unbinding a reserved IP address

Unbinding means that the selected reserved IP is no longer bound to the endpoint gateway. However, the IP address is still reserved and available to be bound again.

To unbind an IP address by using the IBM Cloud console, follow these steps:

  1. From the Virtual private endpoint gateways for VPC page, highlight the row of the gateway in the table, then click Unbind IP from the Actions menu Actions menu. Alternatively, you can unbind a reserved IP from an endpoint gateway's details page.
  2. Click Unbind IP to confirm that you want to unbind this IP from the specified subnet.

Binding and unbinding a reserved IP address from the CLI

You can bind or unbind a reserved IP address by using the CLI.

Before you begin, set up your CLI environment.

Binding a reserved IP to an endpoint gateway

To bind a reserved IP to an endpoint gateway from the CLI, run the following command:

  ibmcloud is endpoint-gateway-reserved-ip-bind ENDPOINT_GATEWAY \
    --reserved-ip-id RESERVED_IP_ID [--json]

Where:

  • ENDPOINT_GATEWAY is the ID of the endpoint gateway.
  • --reserved-ip-id is the reserved IP identity to be used as the primary IP for the network interface. If not specified, an available address on the subnet is selected and reserved automatically.
  • --json forces the operation without confirmation.

Unbinding a reserved IP to an endpoint gateway by using the CLI

To unbind a reserved IP to an endpoint gateway from the CLI, run the following command:

  ibmcloud is endpoint-gateway-reserved-ip-unbind ENDPOINT_GATEWAY \
  (--address ADDRESS | --reserved-ip-id RESERVED_IP_ID) [-f, --force]

Where:

  • ENDPOINT_GATEWAY is the ID of the endpoint gateway.
  • --address is the reserved IP address to be unbound.
  • --reserved-ip-id is the ID of the reserved IP address to be unbound.
  • -f, --force forces the operation without confirmation.

Binding and unbinding a reserved IP address with the API

To bind or unbind a reserved IP address with the API, perform the following prerequisites and procedures.

Prerequisites

The following prerequisites must be met before you can use the API to bind or unbind reserved IP addresses:

  1. Set up your API environment.

  2. Store the following values in variables to use in the API command:

    export EndpointGatewayId=<endpoint_gateway_id>
    export ReservedIPId=<reserved_ip_id>
    

Binding a reserved IP to an endpoint gateway

To bind an endpoint gateway for the specific VPC, see the following example:

curl -X PUT
  -sH "Authorization:${iam_token}"
  "$vpc_api_endpoint/v1/endpoint_gateways/$EndpointGatewayId/ips/$ReservedIPId?version=$api_version&generation=2"

Unbinding a reserved IP to an endpoint gateway

To unbind an endpoint gateway for the specific VPC, see the following example:

curl -X DELETE
  -sH "Authorization:${iam_token}"
  "$vpc_api_endpoint/v1/endpoint_gateways/$EndpointGatewayId/ips/$ReservedIPId?version=$api_version&generation=2"