Files
openstack-manuals/doc/user-guide-admin/section_nova_cli_floating_ips.xml
annegentle 967dcd0c98 Adds information about --fixed-address parameter for nova client
nova add-floating-ip --fixed-address ... added to User Guide

Change-Id: I051cd385c3bae49079926eb930fabb0b120c6564
Closes-bug: 1188856
2013-10-01 10:14:52 -05:00

117 lines
5.9 KiB
XML

<?xml version="1.0" encoding="UTF-8"?>
<section xml:id="manage_ip_addresses"
xmlns="http://docbook.org/ns/docbook"
xmlns:xi="http://www.w3.org/2001/XInclude"
xmlns:xlink="http://www.w3.org/1999/xlink" version="5.0">
<title>Manage IP addresses</title>
<para>Each instance can have a private, or fixed, IP address and an IP
address that is movable from instance-to-instance, (often public),
called a floating IP address.</para>
<para>Private IP addresses are used for communication between
instances, and public ones are used for communication with the
outside world.</para>
<para>When you launch an instance, it is automatically assigned a
private IP address that stays the same until you explicitly
terminate the instance. Rebooting an instance has no effect on
the private IP address.</para>
<para>A pool of floating IPs, configured by the cloud operator, is
available in OpenStack Compute.</para>
<para>You can allocate a certain number of these to a project: The
maximum number of floating IP addresses per project is defined
by the quota.</para>
<para>You can add a floating IP address from this set to an
instance of the project. Floating IP addresses can be
dynamically disassociated and associated with other instances
of the same project at any time.</para>
<para>Before you can assign a floating IP address to an instance,
you first must allocate floating IPs to a project. After
floating IP addresses have been allocated to the current
project, you can assign them to running instances.</para>
<para>One floating IP address can be assigned to only one instance
at a time. Floating IP addresses can be managed with the
<command>nova *floating-ip-*</command> commands, provided
by the python-novaclient package.</para>
<procedure>
<title>To list pools with floating IP addresses</title>
<step>
<para>To list all pools that provide floating IP
addresses:</para>
<screen><prompt>$</prompt> <userinput>nova floating-ip-pool-list</userinput></screen>
</step>
</procedure>
<procedure>
<title>To allocate a floating IP address to the current
project</title>
<step>
<para>The output of the following command shows the
freshly allocated IP address:</para>
<screen><prompt>$</prompt> <userinput>nova floating-ip-pool-list</userinput></screen>
<para>If more than one pool of IP addresses is available,
you can also specify the pool from which to allocate
the IP address:</para>
<screen><prompt>$</prompt> <userinput>floating-ip-create POOL_NAME</userinput></screen>
</step>
</procedure>
<procedure>
<title>To list floating IP addresses allocated to the current
project</title>
<step>
<para>If an IP is already associated with an instance, the
output also shows the IP for the instance, the fixed IP
address for the instance, and the name of the pool
that provides the floating IP address.</para>
<screen><prompt>$</prompt> <userinput>nova floating-ip-list</userinput></screen>
</step>
</procedure>
<procedure>
<title>To release a floating IP address from the current
project</title>
<step>
<para>The IP address is returned to the pool of IP
addresses that are available for all projects. If an
IP address is currently assigned to a running
instance, it is automatically disassociated from the
instance.</para>
<screen><prompt>$</prompt> <userinput>nova floating-ip-delete FLOATING_IP</userinput></screen>
</step>
</procedure>
<procedure>
<title>To assign a floating IP address to an instance</title>
<step>
<para>To associate an IP address with an instance, one or
multiple floating IP addresses must be allocated to
the current project. Check this
with:<screen><prompt>$</prompt> <userinput>nova floating-ip-list</userinput></screen>In
addition, you must know the instance's name (or ID).
To look up the instances that belong to the current
project, use the <code>nova list</code> command.</para>
<screen><prompt>$</prompt> <userinput>nova add-floating-ip INSTANCE_NAME_OR_ID FLOATING_IP</userinput></screen>
<para>After you assign the IP with <command>nova
add-floating-ip</command> and configure security group rules for the instance, the instance is
publicly available at the floating IP
address.
</para>
</step>
</procedure>
<procedure>
<title>To remove a floating IP address from an
instance</title>
<step>
<para>To remove a floating IP address from an instance,
you must specify the same arguments that you used to
assign the IP.</para>
<screen><prompt>$</prompt> <userinput>nova remove-floating-ip INSTANCE_NAME_OR_ID FLOATING_IP</userinput></screen>
</step>
</procedure>
<procedure>
<title>To assign a fixed IP address to a floating address from an
instance</title>
<step>
<para>To allow the floating
IP to be associated with a specific fixed IP, add the fixed IP address as an optional parameter.</para>
<screen><prompt>$</prompt> <userinput>nova add-floating-ip --fixed-address=<replaceable>FIXED_IP_ADDRESS</replaceable> INSTANCE_NAME_OR_ID FLOATING_IP</userinput></screen>
</step>
</procedure>
</section>