Manage floating IP addresses
Create and manage floating IP addresses to enable instance communication with external networks.
Control instance external IP addressing Copy linkLink copied!
Assign a specific floating IP address to an instance.
Before you begin Copy linkLink copied!
- The administrator has created a project for you and has provided you with a
clouds.yamlfile for you to access the cloud. - The
python-openstackclientpackage is on your workstation.$ dnf list installed python-openstackclient
Procedure Copy linkLink copied!
Results Copy linkLink copied!
- Confirm that your floating IP is associated with your instance.
- Example
$ openstack server show prod-serv1- Sample output
+-----------------------------+------------------------------------------+ | Field | Value | +-----------------------------+------------------------------------------+ | OS-DCF:diskConfig | MANUAL | | OS-EXT-AZ:availability_zone | nova | | OS-EXT-STS:power_state | Running | | OS-EXT-STS:task_state | None | | OS-EXT-STS:vm_state | active | | OS-SRV-USG:launched_at | 2024-09-10T13:00:23.000000 | | OS-SRV-USG:terminated_at | None | | accessIPv4 | | | accessIPv6 | | | addresses | public=198.51.100.56,192.0.2.200 | | | | | config_drive | | | created | 2024-09-10T13:00:39Z | | flavor | review-ephemeral | | | (8130dd45-78f6-44dc-8173-4d6426b8e520) | | hostId | 2308c8d8f60ed5394b1525122fb5bf8ea55c78b8 | | | 0ec6157eca4488c9 | | id | aef3ca09-887d-4d20-872d-1d1b49081958 | | image | rhel8 | | | (20724bfe-93a9-4341-a5a3-78b37b3a5dfb) | | key_name | example-keypair | | name | prod-serv1 | | progress | 0 | | project_id | bd7a8c4a19424cf09a82627566b434fa | | properties | | | security_groups | name='default' | | status | ACTIVE | | updated | 2021-09-10T13:02:14Z | | user_id | 4b7e19a0d723310fd92911eb2fe59743a3a5cd32 | | | 45f76ffced91096196f646b5 | | volumes_attached | | +-----------------------------+------------------------------------------+
Create a floating IP pool Copy linkLink copied!
Create a pool of floating IP addresses for instance allocation.
Before you begin Copy linkLink copied!
- The administrator has created a project for you and has provided you with a
clouds.yamlfile for you to access the cloud. - The
python-openstackclientpackage is on your workstation.$ dnf list installed python-openstackclient
About this task Copy linkLink copied!
The Networking service allocates floating IP addresses to all projects (tenants) from the same IP ranges in CIDR format. As a result, all projects can consume floating IPs from every floating IP subnet. You can manage this behavior by using quotas for specific projects. For example, you can set the default to 10 for ProjectA and ProjectB, while setting the quota for ProjectC to 0.
Procedure Copy linkLink copied!
What to do next Copy linkLink copied!
- Confirm that the pool is configured properly by assigning a random floating IP to an instance.
For more information, see Assigning a random floating IP.
Get quick external connectivity with any available IP Copy linkLink copied!
Allocate a random floating IP address from a pool to an instance.
Before you begin Copy linkLink copied!
- The administrator has created a project for you and has provided you with a
clouds.yamlfile for you to access the cloud. - The
python-openstackclientpackage is on your workstation.$ dnf list installed python-openstackclient - A pool of routable external IP addresses.
For more information, see Create a floating IP pool.
Procedure Copy linkLink copied!
Results Copy linkLink copied!
- Enter the following command to confirm that your floating IP is associated with your instance.
- Example
$ openstack server show prod-serv1- Sample output
+-----------------------------+------------------------------------------+ | Field | Value | +-----------------------------+------------------------------------------+ | OS-DCF:diskConfig | MANUAL | | OS-EXT-AZ:availability_zone | nova | | OS-EXT-STS:power_state | Running | | OS-EXT-STS:task_state | None | | OS-EXT-STS:vm_state | active | | OS-SRV-USG:launched_at | 2024-09-10T13:16:43.000000 | | OS-SRV-USG:terminated_at | None | | accessIPv4 | | | accessIPv6 | | | addresses | public=198.51.100.56,192.0.2.200 | | | | | config_drive | | | created | 2024-09-10T13:17:22Z | | flavor | review-ephemeral | | | (8130dd45-78f6-44dc-8173-4d6426b8e520) | | hostId | 2308c8d8f60ed5394b1525122fb5bf8ea55c78b8 | | | 0ec6157eca4488c9 | | id | aef3ca09-887d-4d20-872d-1d1b49081958 | | image | rhel8 | | | (20724bfe-93a9-4341-a5a3-78b37b3a5dfb) | | key_name | example-keypair | | name | prod-serv1 | | progress | 0 | | project_id | bd7a8c4a19424cf09a82627566b434fa | | properties | | | security_groups | name='default' | | status | ACTIVE | | updated | 2024-09-10T13:19:06Z | | user_id | 4b7e19a0d723310fd92911eb2fe59743a3a5cd32 | | | 45f76ffced91096196f646b5 | | volumes_attached | | +-----------------------------+------------------------------------------+
Create floating IP port forwarding for external access Copy linkLink copied!
Configure port forwarding for a floating IP address.
Before you begin Copy linkLink copied!
- The administrator has created a project for you and has provided you with a
clouds.yamlfile for you to access the cloud. - The
python-openstackclientpackage is on your workstation.$ dnf list installed python-openstackclient - Your administrator has enabled the Networking service with the
port_forwardingservice plugin.For information, see Enable floating IP port forwarding for users.
About this task Copy linkLink copied!
You cannot deploy FIP port forwarding and distributed FIP management on a router (ovn-router) if any network connected to the router uses VLAN or Flat tenant network types.
If you have one of those configurations, choose a workaround:
- Use the Geneve network type instead of VLAN or Flat.
- Disable distribute FIP management to use centralized FIP management:
enable_distributed_floating_ip = False
Procedure Copy linkLink copied!
Results Copy linkLink copied!
- Confirm that the Networking service has established forwarding for the floating IP port.
- Example
-
The following example verifies successful port forwarding for the floating IP
198.51.100.47:$ openstack floating ip port forwarding list 198.51.100.47 \ -c "Internal Port ID" -c "Internal IP Address" -c "Internal Port" \ -c "External Port" --max-width 74 - Sample output
-
The output shows that traffic sent to the floating IP
198.51.100.47on TCP port 80 is forwarded to port8080on the instance with the internal address203.0.113.107:+------------------+---------------------+---------------+---------------+ | Internal Port ID | Internal IP Address | Internal Port | External Port | +------------------+---------------------+---------------+---------------+ | 1adfdb09-e8c6-47 | 203.0.113.107 | 8080 | 80 | | 08-b5aa-11f50fc2 | | | | | 2d62 | | | | +------------------+---------------------+---------------+---------------+