Creating an Instance with a Public IP

Creating an Instance with a Public IP

Sometimes your project may require an instance with a public IP address. The OpenStack administrators will grant you public IP addresses (called floating IPs) as needed. The current instructions support creating a new instance with a public floating IP. If you need to associate a public IP with a running instance, you will need to make a snapshot of it first.

Follow these steps to create a new instance with a public floating IP.

Create the Network

  • Navigate to the 'Network' section of left-hand side menu of the CRC OpenStack web interface.
  • Click on the 'Networks' sub-section.
  • Click the '+ Create Network' in the upper right-hand corner of the screen
  • Fill in a name for your network and leave the 'Admin State' checkbox checked
  • Click 'Next'
  • Leave the 'Create Subnet' box checked
  • Fill in a name for your Subnet.
  • Fill in a private IP address in CIDR format. An example would be 192.168.50.0/28. DO NOT USE A CIDR SMALLER THAN /28!!!
  • Do not fill in the 'Gateway IP' and leave the 'Disable Gateway' box unchecked.
  • Click 'Next'
  • Leave the 'Enable DHCP' box checked.
  • Leave the 'Allocation Pools' field empty.
  • Fill in the 'DNS Name Servers' field with 129.74.250.99 and 66.205.160.99 (one IP address per line).
  • Leave the 'Host Routes' field empty.
  • Click 'Create'

Create the Router

  • Click on the 'Routers' sub-section under the 'Network' section in the left-hand side menu of the OpenStack web interface.
  • Click the '+ Create Router' button in the upper right-hand corner of the screen.
  • Fill in a router name, then click 'Create Router'
  • Click on the name of the router you just made in the router list.
  • Click on the 'Interfaces' tab
  • Click the '+ Add Interface' button.
  • Select the Subnet you just made from the drop down menu.
  • Leave the 'IP Address' field blank.
  • Click 'Add Interface'

Associate a Floating IP to Project

  • Navigate to the 'Compute' section of left-hand side menu of the OpenStack web interface.
  • Click on the 'Access and Security' sub-section.
  • Click on the 'Floating IPs' tab
  • Click the 'Allocate IP to Project' button in the upper right-hand corner of the screen.
  • Select 'Public_247' (the only option), then click 'Allocate IP'

Set up the Gateway

  • Navigate to the 'Network' section of left-hand side menu of the CRC OpenStack web interface.
  • Click on the 'Routers' sub-section.
  • Click the 'Set Gateway' corresponding to the router you made earlier.
  • Select 'Public_247' (the only option) from the drop down menu.
  • Click 'Set Gateway'

Create New Instance and Associate Floating IP to the Instance

  • Navigate to the 'Compute' section of left-hand side menu of the OpenStack web interface.
  • Click on the 'Instances' sub-section.
  • Click the '+ Launch Instance' button in the upper right-hand corner of the screen.
  • Fill out the instance details as you would normally.
  • In the networking tab, make sure to select the network you recently created.
  • When you are finished, click 'Launch'
  • Once the instance has launched, click the 'More' drop down menu and select 'Associate Floating IP'
  • Select the Floating IP you want to use.
  • Select the Port to associate. This would be the private network address, typically of the instance you just created.
  • Click 'Associate'

back to top

Delete Network/Router/Subnet Created for Public Floating IP

To remove everything (Network/Router/Subnet) that was created above, the deletion steps have to be done in a specific order.

  • First un-associate any floating IP address(es) that were created using the Network you wish to delete.
  • Delete the Router:
    • Navigate to the 'Network' section of left-hand side menu of the OpenStack web interface.
    • Click on the 'Routers' sub-section.
    • Click the arrow next to the 'Clear Gateway' button and select 'Delete Router' in the drop down menu.
    • Confirm that you want to delete the Subnet in the pop-up display box.
  • Delete the Subnet:
    • Click on the 'Networks' sub-section under the 'Network' section on the left-hand side menu of the web interface.
    • Click on the name of the Network you wish to delete.
    • Under Subnets, click on the arrow next to the 'Edit Subnet' button and select 'Delete Subnet' in the drop down menu.
    • Confirm that you want to delete the Subnet in the pop-up display box.
  • Delete the actual Network:
    • Click on the 'Networks' sub-section under the 'Network' section on the left-hand side menu of the web interface.
    • Click the arrow next to the 'Edit Network' button for the Network you wish to delete and select 'Delete Network' in the drop down menu.
    • Confirm that you want to delete the Network in the pop-up display box.

back to top


OpenStack Main Page