You can assign floating IP addresses to a project and to an instance.
Run the following command to allocate a floating IP address to the current project. If more than one IP address pool is available, you can specify the pool from which to allocate the IP address. This example specifies the
public
pool:$ nova floating-ip-create public
+--------------+-------------+----------+--------+ | Ip | Instance Id | Fixed Ip | Pool | +--------------+-------------+----------+--------+ | 172.24.4.225 | None | None | public | +--------------+-------------+----------+--------+
After at least one floating IP address is allocated to the project, assign an IP address to an instance in the project, as follows:
$ nova add-floating-ip
INSTANCE_NAME_OR_ID
FLOATING_IP
After you assign the IP address and configure security group rules for the instance, the instance is publicly available at the floating IP address.
To remove a floating IP address from an instance, specify the same arguments that you used to assign the IP address, but run the following command:
$ nova remove-floating-ip
INSTANCE_NAME_OR_ID
FLOATING_IP
To release a floating IP address from the current project, run the following command:
$ nova floating-ip-delete
FLOATING_IP
The IP address is returned to the pool of IP addresses that are available for all projects. If an IP address is assigned to a running instance, it is disassociated from the instance.