BMC Public IP Management via Portal and API

February 22, 2022

Introduction

Public IPs allow you to access a BMC server over the internet and not only inside private networks. PhoenixNAP clients can now enjoy the flexibility when choosing IP blocks and how many IP addresses to purchase.

The BMC portal lets you buy and manage Public IP allocations using a streamlined interface. On the other hand, the Public IP APIs are also available for faster and bulk IP management. In this guide, you will learn how to use the Public IP Allocations feature in the BMC portal, as well as get familiar with the BMC Public IP APIs.

BMC Public IP Management via Portal and API heading image

Prerequisites

BMC Portal Public IP Allocations Feature

The Public IP Allocations page lets you purchase, view, and manage public IP blocks for your account. Log in to the BMC portal and navigate to the Public IP Allocations section.

If you have not purchased any public IP blocks yet, the table is empty.

public IP blocks yet the table

Buy Public IP Allocation via Portal

To buy a public IP block and add more IPs to your pool:

1. Log in to the BMC portal.

2. Navigate to the Public IP Allocations page.

3. Select Buy a Public IP Allocation to load the purchase page.

BMC Portal buy a public allocation button.

4. Select a data center location for the public IP block. You can only assign IP blocks to the servers in the same data center location.

Public IP allocation location selection.

5. Choose the public IP allocation size to purchase. The smallest IP block is /31 and can only be used for Linux servers. If you plan to assign the IP block to BMC servers with other OSes, please choose at least /30.

The total price shown is for the whole IP block. Refer to the BMC Billing Models article for more information.

BMC public IP allocation size selection with pricing.

Note: The public IP allocation size you choose must not exceed the total public IP quota for your account. For example, if you have eight public IPs and the quota is 10 for the account, choosing to buy the /29 block does not allow you to complete the purchase. Contact sales to increase the Public IP quota in that case.

6. Click one of the Buy a Public IP Allocation buttons to complete the purchase.

Public IP allocation purchase summary

The public IP block appears in the table with the status Not Assigned.

Public IP allocations table

The Assigned To column shows the status of the IP block and the name of the server when the IP block is assigned.

Assign Public IP Allocation to Server

To assign a public IP allocation to a server:

1. Locate the unassigned public IP allocation in the table and click Actions.

2. Select the Assign IP Allocation link.

Assign public IP allocation action in the BMC portal

3. Click the field in the dialog box and select a server from the list.

Select a server to assign public IP allocation action in the BMC portal

4. Click the Assign IP Allocation button.

When the operation is successful, a confirmation message appears.

Assign public IP allocation confirmation message.

If the operation shows an error, please contact support.

Assign public IP allocation error message.

Note: You can assign one public IP block per server. The BMC Portal does not perform any configuration on the server's operating system. You must make network configuration changes in the operating system of the server after you assign an IP block.

Unassign Public IP Allocation from Server

Removing public IPs from a server makes it accessible only by private networks and via the remote console. Before unassigning a public IP block from a server, test the remote console access is working on that server.

To remove the public IP allocation from a server:

1. Locate the public IP allocation in the table and click Actions.

2. Select the Unassign IP Allocation link.

Unassign public IP allocation action link.

3. Read the notice in the box and enter the CIDR for the IP allocation in question.

Note: Unassigning a public IP allocation from a server does not stop the billing. To stop being billed for a public IP block, you must delete it.

To both unassign and delete an IP allocation, select Yes, unassign and delete this Public IP Allocation.

Unassign public IP allocation confirmation box.

4. Click Unassign Public IP Allocation to proceed. The confirmation message appears.

Unassign public IP allocation confirmation message.

Delete Public IP Allocation

Deleting a public IP allocation from an account removes all its IPs and stops the hourly billing. Only the IP blocks with the status "Unassigned" can be deleted.

To delete a public IP allocation:

1. Locate the unassigned public IP allocation in the table and click Actions.

2. Select the Delete IP Allocation link.

Delete public IP allocation action link.

3. Read the notice in the box and enter the CIDR for the IP allocation you want to delete.

Enter the CIDR for the IP allocation you want to delete

4. Click Delete IP Allocation to confirm the action.

The confirmation message appears when the public IP allocation is deleted.

Note: When you delete an IP block, review any configuration that might be affected by the IP block deletion, such as ACL, DNAT/SNAT and firewall rules, etc.

BMC Public IP Allocations API

BMC public IP allocations APIs cover all the functions you can perform using the BMC portal but with additional flexibility.

The available locations are:

  • Phoenix​ (PHX)
  • Ashburn (ASH)
  • Singapore​ (SGP)              
  • Netherlands (NLD)
  • Chicago (CHI)
  • Seattle​ (SEA)

Use a CIDR depending on the server OS:

  • /31 for Linux only.
  • /30 for all operating systems.
  • /29 for all operating systems.
  • /28 for all operating systems.

Buy Public IP Allocation via API

This API is available at the following URL:

https://api.phoenixnap.com/ips/v1/

Use the POST method and the /ip-blocks endpoint to purchase a public IP block. The required properties are location and cidrBlockSize.

For example:

Purchase a public IP block via API

The response shows the status "UNASSIGNED" when the IP block is created as the allocation is not associated with any resource. Note the id of the block for later use.

Purchase a public IP block via API response.

Get Public IP Inventory Details via API

This API is available at the following URL:

https://api.phoenixnap.com/ips/v1/

To view the list of purchased public IP blocks and their details, use the GET method with the /ip-blocks endpoint.

Get public IP block info via API response.

To view the details of a specific IP block, use the /ip-blocks/id endpoint.

Assign Public IP Allocation to Server via API

The assigning an IP block API is available at the following URL:

https://api.phoenixnap.com/bmc/v1/

Use the /servers/{serverId}/ip-blocks endpoint and the POST method to assign a public IP block to a server. Add the desired IP block's id the only required parameter in the body.

For example:

{
id: "60622a6115e37522c9f8f073"
}

Note: The BMC API does not perform any configuration on the operating system but only on the datacenter's networking device. You must make network configuration changes in the operating system of the server.

Use https://api.phoenixnap.com/ips/v1/ip-blocks/id to verify the IP block status or use the get server details API.

BMC API to verify the IP block status.

Unassign Public IP Allocation from Server via API

This API is available at the following URL:

https://api.phoenixnap.com/bmc/v1/

To remove a public IP block from a server, use the DELETE method with the /servers/{serverId}/ip-blocks/{ipBlockId} endpoint.

Note: This action makes your server unavailable and inaccessible over any network. Before removing a public IP block from a server, make sure you can access the server using the remote console functionality.

The body must include the deleteIpBlocks property. To keep the IP block in your ownership, set the property to false:

{
"deleteIpBlocks":  false
}

Delete Public IP Allocation via API

This API is available at the following URL:

https://api.phoenixnap.com/bmc/v1/

Deleting a public IP allocation is possible only if the block in question is in the unassigned status. When you confirm the status, use the /ip-blocks/{id} endpoint with the DELETE method to remove the IP block from your account.

This action stops the IP hourly billing instantly.

Conclusion

This guide showed you how to use the public IP allocations functionality within the BMC portal. Additionally, you learned how to use the corresponding APIs and what to pay attention to.

To learn more about other APIs phoenixNAP offers, visit the Developers Portal.

Was this article helpful?
YesNo
Goran Jevtic
Goran combines his leadership skills and passion for research, writing, and technology as a Technical Writing Team Lead at phoenixNAP. Working with multiple departments and on various projects, he has developed an extraordinary understanding of cloud and virtualization technology trends and best practices.
Next you should read
Bare Metal Cloud Billing Models
October 30, 2020

This article talks about the available billing models for Bare Metal Cloud servers. Here, you will also learn how to view the usage reports, deploy a server...
Read more
How to Deploy a Bare Metal Cloud Server
March 23, 2021

This article shows how to deploy a new Bare Metal Cloud server in nine simple steps. Follow the instructions to create a server and view server details...
Read more
BMC Server Management via API
December 2, 2021

This guide shows you how to effectively manage BMC servers by using phoenixNAP APIs. This includes Server Tag Manager API, Audit Log API...
Read more
Bare Metal Cloud Portal Quick Start Guide
March 23, 2021

Follow the sections in this Bare Metal Cloud Portal guide to learn how to navigate through the portal. This guide contains everything you need to...
Read more
  • © 2022 Copyright phoenixNAP | Global IT Services. All Rights Reserved.