Create and Manage Floating IPs
Important
In order to associate your Floating IP with an VM instance launched in the IPv4 subnet of your private network, and connect to it via e.g. SSH, you need to Create a Router. in the first place and create an interface in the router for IPv4 subnet.
Floating IP is required to reach your VM in IPv4 subnet from the outside world.
The below guide describes how to create and manage the Floating IP using the Horizon Dashboard and OpenStack CLI.
Create a Floating IP
- Navigate to Project > Network > Floating IPs and click Allocate IP To Project.
- In the popup window that appears ensure Pool is set to
public
, optionally add a Description and click Allocate IP.
- Create a floating IP:
Example output
+---------------------+--------------------------------------+
| Field | Value |
+---------------------+--------------------------------------+
| created_at | 2024-08-30T12:34:56Z |
| description | None |
| fixed_ip_address | None |
| floating_ip_address | 86.119.61.118 |
| floating_network_id | 6c2d6b53-6018-4f2b-a5a3-93916b36d0db |
| id | e61224e9-91bc-4f32-9815-32f5a0ef1f1a |
| port_id | None |
| project_id | a9e8c9c4a8d8475cbbdf5e16e63a4122 |
| router_id | None |
| status | DOWN |
| updated_at | 2024-08-20T12:34:56Z |
+---------------------+--------------------------------------+
Output explanation:
- floating_ip_address: The newly created floating IP address.
- floating_network_id: The ID of the network from which the floating IP was allocated.
- status: The value is
DOWN
because it hasn't been associated with any instance yet.
Associate a Floating IP with a VM Instance
- In Project > Network > Floating IPs locate the floating IP you want to associate with your VM instance and in the Actions column click Associate.
- In Manage Floating IP Associations popup window that appears select the instance you want to associate with this floating IP from the dropdown Port to be associated.
- In IP Address select the Floating IP you want to associate with the VM.
- Cick Associate and return to the Floating IPs page to ensure that the floating IP is now associated with the correct instance. The Mapped Fixed IP Address column should show the name and the fixed private IP address of the instance.
Note
You can also create a new Floating IP from Manage Floating IP Associations popup window using + on the right side of IP Address field. After creating new Floating IP using this option you will be transferred back to Manage Floating IP Associations popup window and your newly created IP will be available in IP Address dropdown field.
Disasociate a Floating IP
-
In Project > Network > Floating IPs locate the floating IP you want to associate and in the Actions column click Disassociate and confirm your action in the popup window that appears.
-
The Floating IP will now be disassociated from the instance and should appear on the list as available for association.
Release a Floating IP
- In Project > Network > Floating IPs locate the floating IP you want to associate and in the Actions dropdown click Release Floating IP and confirm your action in the popup window that appears. It doesn't matter if Floating IP is associated or not.
Disassociate a Floating IP - Explanation
Disassociating a Floating IP means removing the link between the Floating IP and a specific instance (or port). The Floating IP remains in the pool of available IPs, but it is no longer associated with any instance.
-
What happens? The instance loses its public IP address, meaning it is no longer accessible from the public internet. However, the Floating IP remains allocated to your project, so you can associate it with another instance or the same instance later.
-
Example Use Case
-
Temporary Maintenance: If you need to perform maintenance on an instance and don't want it to be accessible from the public internet, you can disassociate the Floating IP. Once the maintenance is complete, you can re-associate the Floating IP with the instance.
-
Switching Instances: If you want to move a Floating IP from one instance to another without releasing it back to the pool, disassociation allows you to remove it from the first instance and then associate it with the second one.
-
Release a Floating IP - Explanation
Releasing a Floating IP means returning the IP address to the pool of available Floating IPs in the OpenStack environment. The Floating IP is no longer associated with your project, and you would have to request a new Floating IP if needed in the future.
-
What happens? The Floating IP is completely de-allocated from your project, meaning it is returned to the pool and can be allocated to another project or user.
-
Example Use Case:
- Resource Cleanup: If you no longer need a Floating IP, such as after deleting an instance permanently, releasing the Floating IP frees it up for use by others in the OpenStack environment. This is useful to avoid unnecessary charges or resource hoarding.
Disassociation vs Releasing a Floating IP
-
Scope of Operation:
- Disassociation: Floating IP remains allocated to your project but is not attached to any instance.
- Releasing: Floating IP is returned to the pool and is no longer allocated to your project.
-
Availability:
- Disassociation: You can re-associate the Floating IP with an instance later.
- Releasing: To use a Floating IP again, you would need to request a new one, which might not be the same IP.
-
Impact:
- Disassociation: The instance loses external connectivity but can regain it with the same IP by re-association.
- Releasing: The instance permanently loses the Floating IP, and the IP may be assigned to a different user.