Assign public IP to instances
Hi all,
I have a server with a public IP that is running Devstack (Pike release). Also, i have available a range of public IPs. What i'm trying to do is assign a public IP to each instance, so i can access them from anywhere. However, i'm having a hard time doing this.
I've been following two approaches:
- Edit local.conf file
From this https://docs.openstack.org/devstack/latest/networking.html#shared-guest-interface (guide) i've added the following parameters to my local.conf:
[[local|localrc]]
PUBLIC_INTERFACE=eth0
HOST_IP=10.42.0.52
FLOATING_RANGE=10.42.0.52/24
PUBLIC_NETWORK_GATEWAY=10.42.0.1
Q_FLOATING_ALLOCATION_POOL=start=10.42.0.250,end=10.42.0.254
Where:
- HOST_IP is the public IP used to access the server and where devstack is running.
- FLOATING_RANGE is the range of public IPs i have available.
- PUBLIC_NETWORK_GATEWAY it's my public gateway.
But when i run this configuration, my public interface receives another IP (something like 172.x.y.z) and i lose the connection to the server.
2.Creating another network manually:
I have followed these steps:
- Creating the network: network type local, checked admin state and external network.
- Creating the subnet: manually typed the public CIDR (x.y.z.192/26) and my public gateway. In the subnet details, i've added the public IP range (x.y.z.201, x.y.z.250) and set DNS.
- To create the router i've assigned it to my previously created network.
- Created security groups for ICMP and SSH.
Instantiate a cirros image with the following command:
openstack server create --flavor d1 --image cirros-0.3.5-x86_64-disk --network ext-network --security-group default --security-group ssh --security-group icmp cirros
However, i get the following error: No sql_connection parameter is established. But i can instantiate this cirros image with the same command in another network (e.g. net0).
Would anyone have any idea how to do this setup?
Thanks in advance.
The External network Should be created for Assigning Public IP to Instances,
To get a Detailed idea for this, post your Exact Requirement