问题
I am facing issue with accessing Open stack VM's on LAN.
- I have setup single machine(192.168.2.15) opensatck using devstack, so all VM's are running inside this machine
- My machine(192.168.2.15) has one network card(eth0) and
- I have nova networking, have not installed neutron.
- I have assigned static IP on eth0 of all the LAN machine( such as 192.168.2.15 and 192.168.2.16) in /etc/network/interfaces file.
System information of the Openstack Machine is as below:
Memory usage: 19% IP address for virbr0: 192.168.122.1
Swap usage: 0% IP address for br100: 10.0.0.1
Below works fine
- I can access internet from VM1(10.0.0.2 which is auto assigned IP).
- I can ping LAN machine(192.168.2.16) from VM1.
- Openstack machine(192.168.2.15) can ping VM1(10.0.0.2).
- VM1(10.0.0.2) can ping VM2(10.0.0.3).
But LAN machine 192.168.2.16 is not able to ping VM1(10.0.0.2)
So please suggest how can it be achieved ? And Please consider me as very new to Openstack and networking.
Thanks !!!
回答1:
You need to assign a floating IP to the VMs you create if you want a host from outside the openstack network to connect to it. The internal IPs are only accessible from inside the openstack network.
See how to assign a floating IP to a VM here: http://docs.openstack.org/user-guide/content/floating_ip_allocate.html
To access the VM's floating IP from another host (that is not the devstack host) you should make sure that the devstack host is configured to forward packets. You can do this with:
sudo bash
echo 1 > /proc/sys/net/ipv4/ip_forward
echo 1 > /proc/sys/net/ipv4/conf/eth0/proxy_arp
iptables -t nat -A POSTROUTING -o eth0 -j MASQUERADE
See more details here: http://barakme.tumblr.com/post/70895539608/openstack-in-a-box-setting-up-devstack-havana-on-your
回答2:
Adding a route to client machine to openstack VM, helped me.
来源:https://stackoverflow.com/questions/23401425/openstack-vm-is-not-accessible-on-lan