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
route add default gw 172.31.2.1
?/etc/network/interfaces
file on Debian? Do you use NetworkManager?