Book Image

OpenStack Networking Cookbook

Book Image

OpenStack Networking Cookbook

Overview of this book

Table of Contents (19 chapters)
OpenStack Networking Cookbook
Credits
About the Authors
About the Reviewers
www.PacktPub.com
Preface
Index

Associating a floating IP address to a virtual machine using the Neutron CLI


We have seen that the Neutron CLI allows users to create a floating IP address independent of the existence of an instance. We will now show you how to associate a floating IP address to an instance using CLI.

Getting ready

For this recipe, you will need to know the virtual interface or the Port of the instance to which you need to bind the floating IP address. You will also need the following information:

  • The login credentials for SSH to a node where the Neutron client packages are installed

  • A shell RC file that initializes the environment variables for CLI

How to do it…

  1. Using the appropriate credentials, SSH into the OpenStack node where the Neutron client software packages are installed.

  2. Source the shell RC file to initialize the environment variables required for the CLI commands.

  3. We will first execute the neutron port-list command to identify the ID of the virtual interface port to which the floating IP will be assigned...