Ask Your Question
4

No internet connection in VMs

asked 2013-09-20 08:35:40 -0500

gvdm gravatar image

Hi to all,

In my Devstack+Neutron machine I launched a Ubuntu Cloud Server 12.04 VM.

I can SSH to that (I associated the keypair to the VM) and do my work on it. The only problem is that I cannot reach Internet from my VM.

I have a proxy in my real network so in the /etc/environment file in the VM I wrote

http_proxy="http://myproxy.server.com:8080/"

and then restarted network services, but it doesn't work. In addition when I try to access the Internet from the VM (by using the wget or apt-get commands, for example) it comes out with the error

Temporary failure resolving "myproxy.server.com"

(of course I used a real proxy, not a fake one).

What should I do to make the VM access the proxy?

Giulio

edit retag flag offensive close merge delete

Comments

I was having the same problem and i fixed it by setting gateway ip to my bridge. I am using flat networking and i have to set my gateway in /etc/network/interface file where i mentioned my bridge details. As I see in your below comments you cannot ping your dns from the instance but you are able to ping it from devstack network. It could be the problem with routing, your bridge is not able to route the traffic to public network. Also see if you have set public interface in nova.conf.

Imran T gravatar imageImran T ( 2013-09-22 09:04:33 -0500 )edit

Hi Imran The problem is that in my /etc/network/interface file I've nothing but the "lo" network definition. So I cannot add the gateway IP to my bridge "ex-br". Should I add the bridge definition in the interface file? And what should I write? Thanks

gvdm gravatar imagegvdm ( 2013-09-27 08:57:09 -0500 )edit

Moreover, where is the nova.conf file in Devstack?

gvdm gravatar imagegvdm ( 2013-09-27 10:05:51 -0500 )edit

4 answers

Sort by ยป oldest newest most voted
6

answered 2013-09-30 05:16:29 -0500

gvdm gravatar image

updated 2013-10-10 02:35:51 -0500

Ok, I solved the problem by executing this command on my Devstack machine:

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

This way you SNAT your "public" network and the VMs can receive the Internet traffic.

Don't forget to give floating IPs to yout VMs!

edit flag offensive delete link more

Comments

1

Love you :)

mani619cash gravatar imagemani619cash ( 2014-04-21 10:00:57 -0500 )edit
1

answered 2015-01-24 22:40:16 -0500

Aswin Mohanan gravatar image

updated 2017-04-06 19:23:01 -0500

zaneb gravatar image

Please enable routing on your bridge device:

iptables -t nat -A POSTROUTING -o br100 -j MASQUERADE
edit flag offensive delete link more

Comments

this fixed the issue that i was having. thank you.

rlastinger gravatar imagerlastinger ( 2015-02-26 19:51:10 -0500 )edit

Masquerading on bridge interface worked for me too. Thank you for the information! :)

sajjanbh gravatar imagesajjanbh ( 2015-11-18 04:16:43 -0500 )edit

I have already disabled my iptables on the node (controller) that hosts the VM. Still unable to access internet. Will the above mentioned command work if iptables are already disabled.

rackerstacker gravatar imagerackerstacker ( 2016-01-26 07:33:39 -0500 )edit
0

answered 2013-09-20 09:18:21 -0500

ArKam gravatar image

It seems to be a resolving issue from my POV. Are you able to ping/reach and request a resolv to your local DNS Server?

edit flag offensive delete link more

Comments

Hi ArKam. No, I cannot ping my DNS server.

gvdm gravatar imagegvdm ( 2013-09-20 09:26:53 -0500 )edit

Ok, so, about me, it's an IP problem there, you should try to disable any firewall or security filter on this host. Plus, you probably should look at you IPConfiguration if it is correct and related to your lan requirements.

ArKam gravatar imageArKam ( 2013-09-24 02:57:22 -0500 )edit

Hi ArKam. What network settings should I check? And where (on the Devstack's host? On the VMs?)? Thanks

gvdm gravatar imagegvdm ( 2013-09-30 04:49:35 -0500 )edit

On the VM indeed.

ArKam gravatar imageArKam ( 2013-09-30 11:58:12 -0500 )edit
0

answered 2013-09-22 06:58:34 -0500

Ashokb gravatar image

updated 2013-09-22 06:59:53 -0500

Hi

Can you update your devstack's private subnet with the DNS ip's specified in your base devstack host's resolv.conf like below

neutron subnet-update subnet-id --dns-nameservers dns_ip1 dns_ip2

This should solve your problem . Hope that helps

edit flag offensive delete link more

Comments

Hi Ashokb. I've updated the private network's DNS with my DNS IPs but the problem remains :(

gvdm gravatar imagegvdm ( 2013-09-27 08:59:12 -0500 )edit

Thanks Ashok. It solved my problem! I gave below command.

$ neutron subnet-update <subnet-id> --dns-nameservers list=true 8.8.8.8

I got <subnet-id> by running $ neutron subnet-list and chose id corresponding to private-subnet

maruti gravatar imagemaruti ( 2017-01-20 08:16:48 -0500 )edit

Your Answer

Please start posting anonymously - your entry will be published after you log in or create a new account.

Add Answer

Get to know Ask OpenStack

Resources for moderators

Question Tools

3 followers

Stats

Asked: 2013-09-20 08:35:40 -0500

Seen: 7,923 times

Last updated: Apr 06 '17