Associating floating IPs with ports in the CLI

Once a floating IP has been created, it is available for use by any user within the project that created it. To associate a floating IP with an instance, it is first necessary to determine the Neutron port that is associated with the fixed IP of the instance.

The port ID associated with the fixed IP address of an instance can be determined in a couple of different ways. The quickest way may be to use the openstack port list command with a filter that can narrow down ports per instance.

For example, the ports of an instance whose ID is 3d577137-9658-4226-906e-88d3117e497e can be determined in the following way:

Once the port ID has been determined, use the openstack floating ip set command to associate the floating IP with the port:

openstack floating ip set --port <port>
[--fixed-ip-address <ip-address>]
<floating-ip>

Neutron uses the subnet ID of the specified port to determine the router in which to configure the floating IP address and respective NAT rules. The logic involved means that no more than one standalone router should be attached to a project network at any given time when floating IPs are used, otherwise unexpected results may occur.

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset