Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

I have a virtual machine on Vsphere 5.0 running Ubuntu 12.04 when i put dinamic IP (/etc/network/interfaces) iface eth0 inet dhcp Ubuntu have network and i can do ping to google for example (8.8.8.8)

but when i put static IP and configure resolv.conf

My interfaces file:

auto eth0
iface eth0 inet static
address 192.168.1.54
gateway 192.168.1.1
netmask 255.255.255.0

it lost the network and i cant do ping to anything...i dont understand where is the problem...

Thanks a lot

share|improve this question

migrated from stackoverflow.com Dec 17 '12 at 10:27

This question came from our site for professional and enthusiast programmers.

add comment

1 Answer

This seems very weird... The fact you are doing this makes me think you are not a novice, but, it looks like it should be correct... so, all I can think of is:

Double check your gateway - is it 192.168.1.1 or could it be 192.168.1.254 or something else?

In addition, I would not manually edit resolv.conf - add the following line:

dns-nameservers x.x.x.x where x is the ip of the DNS server.

That being said, this shouldn't affect pinging 8.8.8.8, so I would also recommend trying to type:

sudo ifconfig eth0 down
sudo ifconfig eth0 up
sudo /etc/init.d/networking restart

and see if you get anywhere...

...If you don't, please set to DHCP, type ifconfig and paste the full output here, followed by making the changes, typing ifconfig and pasting the output here again.

share|improve this answer
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.