Ask Your Question

How to set Floating IP as Instance primary IP ?

asked 2018-04-09 07:41:35 -0500

Shahid gravatar image

Hi all,

After creating an instance in Openstack I found that only the private IP configuration is present inside the Instance. Is there a way through which we can get Public IP configuration as an interface and our floating IP would be used as a primary network interface in the Instance through.

Please let me know if it is possible!!!

edit retag flag offensive close merge delete

1 answer

Sort by » oldest newest most voted

answered 2018-04-09 08:48:31 -0500

You can get the floating IP from the instance’s metadata. See this Stackoverflow question or the metadata service page in the OpenStack documentation.

If I understand you right, you want to add the floating IP to the instance’s network interface. If so, I don’t know what you want to achieve with this. The purpose of the floating IP is instance accessibility from outside the cloud using DNAT; no need to change the configuration inside the instance. If you plan to replace the instance’s address with the floating IP, you will get the opposite result: The instance won’t be accessible via the network without its static IP.

edit flag offensive delete link more


yaa, that's what I wanted, I want that my Floating IP should be visible inside the Instance. If meta_data is the way to do it. Please tell me the procedure how to do it ? @Bernd Bausch

Shahid gravatar imageShahid ( 2018-04-09 09:51:16 -0500 )edit

Check the two links in my answer. Metadata is at Use the ec2data tool, which you may have to install on your instance, or curl, which is usually installed already.

Bernd Bausch gravatar imageBernd Bausch ( 2018-04-09 16:24:42 -0500 )edit

Thanks a ton @Bernd Bausch was able to see the IP by the following curl request


Shahid gravatar imageShahid ( 2018-04-10 08:40:17 -0500 )edit

Get to know Ask OpenStack

Resources for moderators

Question Tools

1 follower


Asked: 2018-04-09 07:41:35 -0500

Seen: 139 times

Last updated: Apr 09 '18