1

Similar to this SU question: https://superuser.com/questions/667631/network-is-unreachable-when-attempting-to-ping-google-but-internal-addresses

Actually, it's pretty much the same base issue. I went through that thread trying to find a solution, I changed my resolv.conf:

before:
domain [my work domain]
search [my work domain]
nameserver [my network DHCP]
nameserver [my network DHCP2]

I changed it to:

after:
domain [my work domain]
search [my work domain]
nameserver 8.8.8.8
nameserver 8.8.4.4

However, any time I reboot the computer the resolv.conf gets overwritten to the previous version (the 'before' above). (it also didn't solve the issue)

The issues began after I installed virtualbox additions (AKA on a fresh install and after installation of Samba it worked on the internet and my internal network perfectly), X server and (specifically) LXDE:

Cat of apt history.log:

Start-Date: 2014-08-21  10:03:42
Commandline: apt-get install virtualbox-guest-utils virtualbox-guest-dkms
Install: x11-xkb-utils:amd64 (7.7+1, automatic), libxaw7:amd64 (1.0.12-2, automatic), xfonts-utils:$
End-Date: 2014-08-21  10:03:56

Start-Date: 2014-08-21  10:18:39
Commandline: apt-get install lxde
Install: desktop-base:amd64 (7.0.3, automatic), libgoa-1.0-0b:amd64 (3.12.4-1, automatic), lxmenu-d$
End-Date: 2014-08-21  10:21:52

Start-Date: 2014-08-21  10:26:40
Commandline: apt-get upgrade
Upgrade: libio-socket-ssl-perl:am

ifconfig on the guest:

root@Peridot:~# ifconfig
eth0      Link encap:Ethernet  HWaddr 08:00:27:89:c9:20  og
          inet addr:172.31.2.102  Bcast:172.31.2.255  Mask:255.255.255.0
          inet6 addr: fe80::a00:27ff:fe89:c920/64 Scope:Link
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
          RX packets:2281 errors:0 dropped:1 overruns:0 frame:0
          TX packets:463 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000
          RX bytes:266507 (260.2 KiB)  TX bytes:120554 (117.7 KiB)

lo        Link encap:Local Loopback
          inet addr:127.0.0.1  Mask:255.0.0.0
          inet6 addr: ::1/128 Scope:Host
          UP LOOPBACK RUNNING  MTU:65536  Metric:1
          RX packets:4 errors:0 dropped:0 overruns:0 frame:0
          TX packets:4 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:0
          RX bytes:240 (240.0 B)  TX bytes:240 (240.0 B)

The adapter in VBox is a bridged adapter directly onto my ethernet connection; as are my other 2 VMs (which work)

Other questions I've tried:

Edit:

netstat:

root@Peridot:~# netstat -r
Kernel IP routing table
Destination     Gateway         Genmask         Flags   MSS Window  irtt Iface
10.13.36.0      172.31.2.254    255.255.255.0   UG        0 0          0 eth0
172.31.2.0      *               255.255.255.0   U         0 0          0 eth0

/etc/network/interfaces:

root@Peridot:~# cat /etc/network/interfaces
# This file describes the network interfaces available on your system
# and how to activate them. For more information, see interfaces(5).

# The loopback network interface
auto lo
iface lo inet loopback

# The primary network interface
auto eth0
allow-hotplug eth0
iface eth0 inet dhcp

Per this question I've done the following with no success (thapphireth is my local machine hosting the VM. Also works if I ping other computers on the network):

root@Peridot:~# ps aux | grep dhclient
root      1849  0.0  1.3  14848  6984 ?        Ss   14:28   0:00 dhclient -v -pf                                                                                                                                                              /run/dhclient.eth0.pid -lf /var/lib/dhcp/dhclient.eth0.leases eth0
root      1960  0.0  0.1  12680   940 pts/0    S+   14:30   0:00 grep dhclient
root@Peridot:~# ps aux | grep dhclient
root      1849  0.0  1.3  14848  6984 ?        Ss   14:28   0:00 dhclient -v -pf /run/dhclient.eth0.pid -lf /var/lib/dhcp/dhclient.eth0.leases eth0
root      1963  0.0  0.1  12680   940 pts/0    S+   14:30   0:00 grep dhclient
root@Peridot:~# kill 1849
root@Peridot:~# ps aux | grep dhclient
root      1965  0.0  0.1  12680   940 pts/0    S+   14:30   0:00 grep dhclient
root@Peridot:~# dhclient eth0
RTNETLINK answers: File exists
root@Peridot:~# ping google.com
connect: Network is unreachable
root@Peridot:~# ping thapphireth
PING thapphireth.SID (172.31.2.67) 56(84) bytes of data.
64 bytes from 172.31.2.67: icmp_seq=1 ttl=128 time=0.269 ms
64 bytes from 172.31.2.67: icmp_seq=2 ttl=128 time=0.428 ms
^C
--- thapphireth.SID ping statistics ---
2 packets transmitted, 2 received, 0% packet loss, time 1001ms
rtt min/avg/max/mdev = 0.269/0.348/0.428/0.081 ms
root@Peridot:~# ps aux | grep dhclient
root      2009  0.0  1.3  14848  6984 ?        Ss   14:30   0:00 dhclient eth0
root      2013  0.0  0.1  12680   944 pts/0    S+   14:30   0:00 grep dhclient
root@Peridot:~# kill 2009
root@Peridot:~# dhclient -v -pf /run/dhclient.eth0.pid -lf /var/lib/dhcp/dhclient.eth0.leases eth0
Internet Systems Consortium DHCP Client 4.3.1
Copyright 2004-2014 Internet Systems Consortium.
All rights reserved.
For info, please visit https://www.isc.org/software/dhcp/

Listening on LPF/eth0/08:00:27:89:c9:20
Sending on   LPF/eth0/08:00:27:89:c9:20
Sending on   Socket/fallback
DHCPREQUEST on eth0 to 255.255.255.255 port 67
DHCPACK from 172.31.2.42
RTNETLINK answers: File exists
bound to 172.31.2.102 -- renewal in 277205 seconds.
root@Peridot:~# ping google.com
connect: Network is unreachable
root@Peridot:~# ping thapphireth
PING thapphireth.SID (172.31.2.67) 56(84) bytes of data.
64 bytes from 172.31.2.67: icmp_seq=1 ttl=128 time=0.251 ms
64 bytes from 172.31.2.67: icmp_seq=2 ttl=128 time=0.798 ms
^C
--- thapphireth.SID ping statistics ---
2 packets transmitted, 2 received, 0% packet loss, time 1001ms
rtt min/avg/max/mdev = 0.251/0.524/0.798/0.274 ms
root@Peridot:~#

results of ipconfig on windows (host machine):

Windows IP Configuration
Ethernet adapter vEthernet (Broadcom NetLink (TM) Gigabit Ethernet Virtual Switch):

   Connection-specific DNS Suffix  . : SID
   Link-local IPv6 Address . . . . . : fe80::5d00:6fe1:98d2:ac06%9
   IPv4 Address. . . . . . . . . . . : 172.31.2.67
   Subnet Mask . . . . . . . . . . . : 255.255.255.0
   Default Gateway . . . . . . . . . : 172.31.2.1
  • Which version of Windows do you have? How did you configure it? Which virtualization software are you using? How did you configure the virtual network? – pqnet Aug 22 '14 at 20:14
  • It's windows 8. How did I configure what? It's worth noting (it's in there, but so are a lot of things) that everything was working before installation of Vboxadditions/XServer/LXDE – Mitch Aug 22 '14 at 20:21
  • does everything work if you use route add default gw 172.31.2.1? – pqnet Aug 22 '14 at 20:28
  • It does! However, upon reboot, it doesn't... Any clue how to make that stick? Also, will I have issues if I try to run this VM on a different network like that? – Mitch Aug 22 '14 at 20:34
  • the problem is what has been spotted by Mathias Weidner in his answer: you need to configure a default gateway in your guest machine, and the DHCP should take care of that. What is the content of /etc/network/interfaces file on Debian? Do you use NetworkManager? – pqnet Aug 22 '14 at 20:37
1

The output from netstat -r does not contain a defaultroute.

This should come via DHCP from your VM host software.

Edit:

You may try to find out whether the defaultroute gets configured or not using rtmon and ip from the package iproute. With rtmon you may watch the netlink interface of the kernel and with ip you may have a look at these logs.

Shutdown the interface with ifdown eth0 and start rtmon like this:

rtmon file /var/log/rtmon.log

Then activate the network interface with ifup eth0. After you've got an IP address, look at the logs with

ip monitor file /var/log/rtmon.log | less

Look for something like

default via 172.31.2.x dev eth0

If you find it, you probably got a defaultroute from DHCP and the problem is somewhere on your VM. If you don't find it, it's probably a problem with DHCP.

  • the network seems to have been configured as bridged, so the problem is most likely on some configuration overriding the DHCP default gateway in the guest machine (it's unlikely that the dhcp, which also serves the host window machine, is not working) – pqnet Aug 22 '14 at 20:41
0

Your VM, in addition to getting a IP from the DHCP server, is also getting the nameserver as well. You can either override this at the DHCP server or you can setup the Debian VM to inject its own options instead.

Take a look at how to accomplish this in my answer to this other U&L Q&A titled: Can I set my Debian box to use OpenDNS nameservers if it uses DHCP?. In this I show 2 methods on how to do this, the other 2 answers show configuration options that you can give to dhcpclient to instruct it on how to override.

  • One question about that: I was using the google dns servers just to try to get online. If I make them the default, will that make me unable to talk to other computers on my work network by their names? DNS isn't the issue, connectivity is, I can't ping google.com or any IP – Mitch Aug 22 '14 at 18:36
  • @musher - yes, but you can put both Google's and your DNS in the mix to solve that. – slm Aug 22 '14 at 18:37
  • Well, that's cool, but the issue is really that I can't connect to the external internet - even by ping ${IP address} – Mitch Aug 22 '14 at 18:38
  • @musher - ahh. Different issue. I see you updated your Q. Is 10.13.36.0 your router/switch? – slm Aug 22 '14 at 18:39
  • I'll update the Q with the ipconfig from windows (which works). It seems that my router is 172.31.2.1 – Mitch Aug 22 '14 at 18:42

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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