Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Any advise how to get access to internet from instances? #2

Closed
simpl1g opened this issue Oct 15, 2013 · 6 comments
Closed

Any advise how to get access to internet from instances? #2

simpl1g opened this issue Oct 15, 2013 · 6 comments

Comments

@simpl1g
Copy link

simpl1g commented Oct 15, 2013

I've just installed devstack and everything look to be working fine, except one thing, I can't get access to internet from instances.
I can ssh into instance from my local machine with floating ip and i can ssh back into my local machine from instance, but i can't get access to my local network.

I'd be very grateful for any assistance.

@lorin
Copy link
Owner

lorin commented Oct 15, 2013

Unfortunately, I don't think there's an easy way to configure things to allow an instance to connect out to the internet. This is because the VirtualBox network interface associated with the floating IPs is associated with a vagrant "private network", so there are no rules for routing packets out to the internet.

You could configure Vagrant to use bridged networking mode, and that way the virtual machine running devstack would be connected directly to your local network. However, then you need to make sure that the subnet you specify in the vagrantfile matches the subnet of your local network (you would need to change this from 172.24.4.225/27 to whatever your local network uses), and you also need to make sure that OpenStack doesn't hand out an IP that's already used on your subnet.

The alternative is to configure your host operating system to NAT the connections out. Configuring this is non-trivial and depends on what operating system you are running on the host.

@simpl1g
Copy link
Author

simpl1g commented Oct 15, 2013

Thx for reply, I had some experiments with NAT on my Ubuntu, so I'll keep moving forward with that, I thought that it's common problem :)

@lorin
Copy link
Owner

lorin commented Oct 16, 2013

Note that the newest release of VirtualBox (4.3) now has experimental support for NAT. Might be able to use this to allow instances to connect out the Internet.

@marklee77
Copy link

If you have an up-to-date copy of vagrant and can get access to the internet from the network node through eth0, then the solution is just to tell iptables to masquerade traffic passing out through that interface.

iptables -t nat -A POSTROUTING -o eth0 -j MASQUERADE

At least, this fixed the problem for me. YMMV.

I haven't yet figured out how to make it so you can connect to VMS from the controller node in virtualbox.

@simpl1g
Copy link
Author

simpl1g commented Oct 17, 2013

Running this on my host machine solved the problem

echo 1 > /proc/sys/net/ipv4/ip_forward
iptables -t nat -I POSTROUTING -o eth0 -j MASQUERADE

Lorin you can add it to README:)
Thanks all!

@lorin
Copy link
Owner

lorin commented Oct 18, 2013

README updated at 6db0232

@lorin lorin closed this as completed Oct 18, 2013
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants