NAT Network: Cannot ping gateway, no name resolution

Discussions related to using VirtualBox on Linux hosts.
Post Reply
drosera
Posts: 1
Joined: 20. Aug 2015, 19:18

NAT Network: Cannot ping gateway, no name resolution

Post by drosera »

Hi,

I need to set up a small internal VB guest network where one of the guests will act as a DHCP server for the others but all guests can still access the internet. I therefore selected the "NAT Network" type of networking. However I'm stuck with the first guest already: When using NAT Network, the guest cannot resolve names.

On the guest (Ubuntu 14.04 LTS) I see

Code: Select all

$ ifconfig eth0
eth0      Link encap:Ethernet  HWaddr 08:00:27:6e:5d:50  
          inet addr:10.0.2.4  Bcast:10.0.2.255  Mask:255.255.255.0
          inet6 addr: fe80::a00:27ff:fe6e:5d50/64 Scope:Link
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
          RX packets:3665 errors:0 dropped:0 overruns:0 frame:0
          TX packets:1212 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000 
          RX bytes:4322976 (4.3 MB)  TX bytes:167499 (167.4 KB)

$ netstat -rn
Kernel IP routing table
Destination     Gateway         Genmask         Flags   MSS Window  irtt Iface
0.0.0.0         10.0.2.1        0.0.0.0         UG        0 0          0 eth0
10.0.2.0        0.0.0.0         255.255.255.0   U         0 0          0 eth0
$ cat /etc/resolv.conf 
# Dynamic resolv.conf(5) file for glibc resolver(3) generated by resolvconf(8)
#     DO NOT EDIT THIS FILE BY HAND -- YOUR CHANGES WILL BE OVERWRITTEN
nameserver 127.0.1.1
search this.is.our.domain
$ 
Looks ok, but then:

Code: Select all

$ ping 10.0.2.1
PING 10.0.2.1 (10.0.2.1) 56(84) bytes of data.
From 10.0.2.4 icmp_seq=1 Destination Host Unreachable
From 10.0.2.4 icmp_seq=2 Destination Host Unreachable
From 10.0.2.4 icmp_seq=3 Destination Host Unreachable
^C
--- 10.0.2.1 ping statistics ---
5 packets transmitted, 0 received, +3 errors, 100% packet loss, time 4016ms
pipe 3
$ nslookup some.known.host
;; connection timed out; no servers could be reached

$ 
On the host (openSUSE 13.2) it looks ok, too:

Code: Select all

$ VBoxManage list dhcpservers
NetworkName:    FAINATNetwork
IP:             10.0.2.3
NetworkMask:    255.255.255.0
lowerIPAddress: 10.0.2.4
upperIPAddress: 10.0.2.254
Enabled:        Yes

$

$ VBoxManage list natnetworks
NetworkName:    FAINATNetwork
IP:             10.0.2.1
Network:        10.0.2.0/24
IPv6 Enabled:   No
IPv6 Prefix:    
DHCP Enabled:   Yes
Enabled:        Yes
loopback mappings (ipv4)
        127.0.0.1=2

$
But in ~/.config/VirtualBox/VBoxSVC.log I found:

Code: Select all

[...]
04:23:49.725479 nspr-4   VM 'faiserver' starts using NAT network 'FAINATNetwork'
04:23:49.953535 nspr-4   Error NS_ERROR_FAILURE starting NAT network 'FAINATNetwork'
04:23:49.982841 nspr-3   HostDnsMonitorProxy::GetNameServers:
04:23:49.982864 nspr-3     name server 1: 123.45.67.89
04:23:49.982938 nspr-5   HostDnsMonitorProxy::GetDomainName: this.is.our.domain
When switching to the "old" NAT mode, almost everything is the same (the guest even gets the same IP number) with the exception, that the default gateway is now 10.0.2.2, it is pingable and name resolution works. However this NAT mode won't work for me as I'll need my own DHCP server within the internal network for testing.

I'm at a loss here. Any suggestions on what the problem could be or how I could debug the issue?

Cheers
frank
noteirak
Site Moderator
Posts: 5229
Joined: 13. Jan 2012, 11:14
Primary OS: Debian other
VBox Version: OSE Debian
Guest OSses: Debian, Win 2k8, Win 7
Contact:

Re: NAT Network: Cannot ping gateway, no name resolution

Post by noteirak »

Please read Minimum information needed for assistance and provide zipped attachment of the VM log file and the guest settings.
This will give us a first good step in finding out what exactly happened when the NAT network failed to start.
Hyperbox - Virtual Infrastructure Manager - https://apps.kamax.lu/hyperbox/
Manage your VirtualBox infrastructure the free way!
Carrot Cruncher
Posts: 5
Joined: 9. Aug 2010, 19:00
Primary OS: Fedora other
VBox Version: OSE Fedora
Guest OSses: Fedora

Re: NAT Network: Cannot ping gateway, no name resolution

Post by Carrot Cruncher »

I've just tried using "NAT Network" and I'm experiencing the same symptoms, although I'm not seeing the same errors in the log.

Host : Fedora 22 (64-bit) : VirtualBox-4.3.30-1.fc22.x86_64 package installed from RPM Fusion repo : 16GB memory
Guest : Fedora 22 (64-bit) (Other Linux guests have exactly the same issue) : VirtualBox-guest-4.3.30-1.fc22.x86_64 package installed from RPM Fusion repo : 4GB memory

The latest updates have been applied to all packages on both the Host and the Guest.

The attached zip file contains the following:
NAT.log : Results from "ip addr", "ip route", & "ping {default gateway}" on guest while network set to NAT
NAT Network.log : Results from "ip addr", "ip route", & "ping {default gateway}" on guest while network set to NAT Network
VBoxSVC_NAT.log : Log file while network set to NAT
VBoxSVC_NAT Network.log : Log file while network set to NAT Network
VirtualBox.xml : VirtualBox config file
Fedora (64 bit).vbox : Guest config file

If you need any more info, please let me know. Cheers.
Attachments
VirtualBox.zip
(10.56 KiB) Downloaded 62 times
noteirak
Site Moderator
Posts: 5229
Joined: 13. Jan 2012, 11:14
Primary OS: Debian other
VBox Version: OSE Debian
Guest OSses: Debian, Win 2k8, Win 7
Contact:

Re: NAT Network: Cannot ping gateway, no name resolution

Post by noteirak »

Other versions than the official version which you can download on the website are not supported here. Also, well done for all the logs but you missed the VM log as indicated in the link.
Hyperbox - Virtual Infrastructure Manager - https://apps.kamax.lu/hyperbox/
Manage your VirtualBox infrastructure the free way!
Carrot Cruncher
Posts: 5
Joined: 9. Aug 2010, 19:00
Primary OS: Fedora other
VBox Version: OSE Fedora
Guest OSses: Fedora

Re: NAT Network: Cannot ping gateway, no name resolution

Post by Carrot Cruncher »

Ah, sorry, didn't realise other distributions wouldn't be supported. For reference, attached is a zip file with the VM logs included this time.

VBox_NAT.log : VM log while network set to NAT
VBox_NAT Network.log : VM log while network set to NAT Network
Attachments
VirtualBox.zip
(59.66 KiB) Downloaded 83 times
Carrot Cruncher
Posts: 5
Joined: 9. Aug 2010, 19:00
Primary OS: Fedora other
VBox Version: OSE Fedora
Guest OSses: Fedora

Re: NAT Network: Cannot ping gateway, no name resolution

Post by Carrot Cruncher »

I have replaced the package from the RPM Fusion repo with the package from your repo and the problem is resolved for me. Thanks for pointing me in the right direction and apologies for wasting your time.
noteirak
Site Moderator
Posts: 5229
Joined: 13. Jan 2012, 11:14
Primary OS: Debian other
VBox Version: OSE Debian
Guest OSses: Debian, Win 2k8, Win 7
Contact:

Re: NAT Network: Cannot ping gateway, no name resolution

Post by noteirak »

As long as it solved the problem for you, never a waste of time. thank you for following up!
Hyperbox - Virtual Infrastructure Manager - https://apps.kamax.lu/hyperbox/
Manage your VirtualBox infrastructure the free way!
Post Reply