Page 1 of 1

Host only networking incomplete HWaddress

Posted: 21. Jun 2011, 18:08
by ndastur
Host setup:
Centos 5.6
VirtualBox 4.0.8
eth0 has a statically configured IP (non-private address)

Guest setup:
Centos 5.6
Guest additions installed
Two NICs
eth0 - NAT interface with DHCP assigned IP
eth1 - Host only interface with statically assigned 192.168.56.10 (DHCP disabled on vboxnet0)

I would think with this setup the guest should be able to connect in/out to the world at large and the host system should be able to connect to the guest using for example ssh 192.168.56.10. However, I have been tearing my hair out as I just can't seem to get it to work.

From host:
# ping 192.168.56.10 gives
PING 192.168.56.10 (192.168.56.10) 56(84) bytes of data.
From 192.168.56.1 icmp_seq=2 Destination Host Unreachable
From 192.168.56.1 icmp_seq=3 Destination Host Unreachable
From 192.168.56.1 icmp_seq=4 Destination Host Unreachable
and at this point on the host
# arp -n
Address                  HWtype  HWaddress           Flags Mask            Iface
192.168.56.10                    (incomplete)                              vboxnet0
[my internet IP]            ether   00:00:xx:xx:xx:xx   C                     eth0
[my internet IP GW]      ether   00:10:xx:xx:xx:xx   C                     eth0
Now the weird thing I found by chance is that if I ping from the guest to 192.168.56.1 firstly that works fine and now on the host
# arp -n
Address                  HWtype  HWaddress           Flags Mask            Iface
192.168.56.10            ether   02:00:02:00:AA:02   C                     vboxnet0
[my internet IP GW]    ether   00:00:xx:xx:xx:xx   C                     eth0
and so now a ping from host to guest works as does ssh
# ping 192.168.56.10
PING 192.168.56.10 (192.168.56.10) 56(84) bytes of data.
64 bytes from 192.168.56.10: icmp_seq=1 ttl=64 time=0.123 ms
64 bytes from 192.168.56.10: icmp_seq=2 ttl=64 time=0.119 ms
64 bytes from 192.168.56.10: icmp_seq=3 ttl=64 time=0.117 ms
but this only lasts along as a arp cache time (20mins or so)

Is there something wrong in my setup, or is this a VB bug?

Re: Host only networking incomplete HWaddress

Posted: 21. Jun 2011, 23:51
by Martin
Does the host also have an address in the 192.168.56.x network on the host only adapter vboxnet0?

Re: Host only networking incomplete HWaddress

Posted: 22. Jun 2011, 12:56
by ndastur
No it doesn't.

The host routing table looks like this
/sbin/route -n
Kernel IP routing table
Destination     Gateway         Genmask         Flags Metric Ref    Use Iface
94.75.xxx.xxx   0.0.0.0         255.255.255.240 U     0      0        0 eth0
192.168.56.0    0.0.0.0         255.255.255.0   U     0      0        0 vboxnet0
169.254.0.0     0.0.0.0         255.255.0.0     U     0      0        0 eth0
0.0.0.0         94.75.xxx.xxx   0.0.0.0         UG    0      0        0 eth0
I also reconfigured the guest eth1 to use a VB assigned MAC address, in case the local MAC was the problem and that didn't make any difference either. Looking more and more like a VB bug

Re: Host only networking incomplete HWaddress

Posted: 22. Jun 2011, 13:49
by Martin
To be able to send and receive packages from the 192.168.56.0 network your host needs to have an IP address from that network on the vboxnet0 interface.
vboxnet0 should have the address 192.168.56.1 when a guest with hostonly networking is active and you didn't change the default settings under "File" .> "Preferences" -> "Network"

Re: Host only networking incomplete HWaddress

Posted: 22. Jun 2011, 13:57
by ndastur
I don't quite understand.

The interface vboxnet0 should give me the IP on my host machine (i.e. 192.168.56.1). And from the guest POV this happens, hence I am able to ping out. I have left the defaults from the file->preferences->network for vboxnet0. Tried with both dhcp and without. Although DHCP should have nothing to do with it.

BTW this all works flawlessly on OSX

Re: Host only networking incomplete HWaddress

Posted: 23. Jun 2011, 16:08
by mschwartz
I'm not a centos guy, but what you've described looks like a centos problem. The sending out of ARP packets is a function of the OS, not of virtualbox.

Without further details, my guess would be you have some sort of ip firewall causing problems. It might be on the guest or the host, but it looks more likely to be on the host.

More on ARP here:

http://en.wikipedia.org/wiki/Address_Re ... n_Protocol

Re: Host only networking incomplete HWaddress

Posted: 23. Jun 2011, 16:38
by ndastur
Thank you. I will look into further, however, I did wonder about this and brief turned off my firewall and also made sure selinux was disabled etc -> no difference.

Re: Host only networking incomplete HWaddress

Posted: 23. Jun 2011, 17:04
by Y E T I
My experience with centos is that is is some what anal when it comes to the nics and how they are configured. I find it works better of the eth0=host-only and eth1=nat

Re: Host only networking incomplete HWaddress

Posted: 23. Jun 2011, 19:33
by ndastur
Thank you for suggestion, but no luck with my ubuntu box either. Exactly the same problem occurs, i.e. I can ping out but not in, unless I do ping out first

Re: Host only networking incomplete HWaddress

Posted: 23. Jun 2011, 20:49
by ndastur
Okay, things just got a little weirder ...

I was continuing to try and investigate the problem and if I am running
$ sudo tcpdump -ni vboxnet0 -f arp
to capture and display the arp stream then I can suddenly ping my virtual boxes! So there must be something in the setup of vboxnet0 as an interface.

Does anyone know how and where the adaptor vboxnet0 is created?