Can ping IP but not host

Discussions about using Linux guests in VirtualBox.
Post Reply
holden321
Posts: 3
Joined: 21. May 2016, 20:02

Can ping IP but not host

Post by holden321 »

auto lo
iface lo inet loopback

# The primary network interface
auto eth0
auto eth1

iface eth0 inet dhcp

iface eth1 inet static
address 192.168.56.102
netmask 255.255.255.0
gateway 10.0.2.2
I can do "ping 213.180.204.3" but can't do "ping ya[.]ru"

this "nslookup ya[.]ru 8.8.8.8" works ok
this "nslookup ya[.]ru" says "connection time out; no servers could be reached"

eth0 is NAT
eth1 is Host Only Adapter

If I switch off eth1 from the machine settings (leaving eth0) all works ok. But I can't switch off this iface.

Please help :roll:
socratis
Site Moderator
Posts: 27329
Joined: 22. Oct 2010, 11:03
Primary OS: Mac OS X other
VBox Version: VirtualBox+Oracle ExtPack
Guest OSses: Win(*>98), Linux*, OSX>10.5
Location: Greece

Re: Can ping IP but not host

Post by socratis »

Your eth1 address is 192.168.56.102. This looks like a host-only choice of networking mode. The gateway is 10.0.2.2. That looks like a NAT networking mode. Your eth1 address and gateway are in completely different address ranges. Not gonna work. Why do you have to set it up manually and don't you just leave it to auto?
Do NOT send me Personal Messages (PMs) for troubleshooting, they are simply deleted.
Do NOT reply with the "QUOTE" button, please use the "POST REPLY", at the bottom of the form.
If you obfuscate any information requested, I will obfuscate my response. These are virtual UUIDs, not real ones.
holden321
Posts: 3
Joined: 21. May 2016, 20:02

Re: Can ping IP but not host

Post by holden321 »

Well, that configuration works fine for some time.
Second adapter (eth1) is for connecting through VPN
socratis
Site Moderator
Posts: 27329
Joined: 22. Oct 2010, 11:03
Primary OS: Mac OS X other
VBox Version: VirtualBox+Oracle ExtPack
Guest OSses: Win(*>98), Linux*, OSX>10.5
Location: Greece

Re: Can ping IP but not host

Post by socratis »

I'm not a network expert, but I've seen too many posts where VPN had no success. But, I would wait for someone with more networking knowledge than myself...
Do NOT send me Personal Messages (PMs) for troubleshooting, they are simply deleted.
Do NOT reply with the "QUOTE" button, please use the "POST REPLY", at the bottom of the form.
If you obfuscate any information requested, I will obfuscate my response. These are virtual UUIDs, not real ones.
holden321
Posts: 3
Joined: 21. May 2016, 20:02

Re: Can ping IP but not host

Post by holden321 »

It starts to work if I add nameserver 8.8.8.8 here:
/etc/resolv.conf
But it's overwriting after reboot ^(
Post Reply