Reassigning floating IPs

Neutron provides the ability to quickly disassociate a floating IP from an instance or other network resource and associate it with another. A list of floating IPs shows the current association:

Using the openstack floating ip unset and openstack floating ip set commands, disassociate the floating IP from MyInstance1 and associate it with MyInstance2. The disassociation can be seen here:

No output will be returned if the command is successful. The openstack floating ip list command shows that the floating IP is no longer associated with a port:

The floating IP is still owned by the project that created it and cannot be assigned to another project without first being deleted.

Using the openstack floating ip set command, associate the floating IP with the port of MyInstance2, as shown in the following screenshot:

No output will be returned if the command is successful. Observe the iptables rules within the router namespace. The NAT relationship has been modified, and traffic from MyInstance2 will now appear as the floating IP:

As a result of the new association, attempting an SSH connection to the floating IP may result in the following message on the client machine:

The warning message is a good indicator that traffic is being sent to a different host. Clearing the offending key and logging into the instance reveals it to be MyInstance2:

At this point, we have successfully deployed two instances behind a single virtual router and have verified connectivity to and from the instances using floating IPs. In the next section, we will explore how those same tasks can be accomplished within the Horizon dashboard.

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

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