Ask Ubuntu is a question and answer site for Ubuntu users and developers. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I'm running Ubuntu server via Hyper-V and have successfully installed it but seem unable to ping the server or ping any other machines on the network from the server.

After doing a bit of reading I've noticed that the default gateway isn't set but when I try and set it I keep getting error messages which I can't understand.

From this article I've tried

ip route add default via

Which reports: RTNETLINK answers: Operation not permitted

If I try running it prefixed with sudo but it reports: `RNETLINK answers: No such process

I've editted /etc/network/interfaces but when I start the machine and type netstat -nr there is nothing listed.

Can anyone tell me where I'm going wrong please?

EDIT : /etc/network/interfaces contains:

auto lo
iface lo inet loopback

auto eth0
iface eth0 inet dhcp

IP address: Subnet mask:

share|improve this question
Try sudo route add default gw – pl1nk Jun 7 '12 at 9:43
@pl1nk - That returns "SIOCADDRT: No such process" – GrandMasterFlush Jun 7 '12 at 9:57
Could you post the contents of /etc/network/interfaces ? – pl1nk Jun 7 '12 at 10:02
@pl1nk - Added. – GrandMasterFlush Jun 7 '12 at 10:06
Try: sudo route del default and then sudo route add default gw – pl1nk Jun 7 '12 at 10:20
up vote 0 down vote accepted

Frustratingly, I had to rebuild the Ubuntu server to get this working. I had it connecting to the network before the problem as I was running updates and using apt-get. Having followed the same steps as I did yesterday and installing the same packages the machine is working without any problems.

The only thing I can think of is that either Hyper-V has corrupted the installation at some point or that there have been problems when the machine has gone into hibernation overnight. I've suffered problems with network connectivity after hibernation with Hyper-v & Ubuntu before but that was on an older version of the software and a re-start of the Ubuntu virtual server stopped the problem - this did not work today and the rebuild was the only solution.

I'd like to thank Pl1nk for sparing his time and taking me through all of the various network settings of the Ubuntu box as he tried to solve this problem.

share|improve this answer
Thanks, you could upvote me if you like :) – pl1nk Jun 7 '12 at 22:02
Still working this morning, so it doesn't seem that it was the hibernate bug. – GrandMasterFlush Jun 8 '12 at 8:41

Your Answer


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

Not the answer you're looking for? Browse other questions tagged or ask your own question.