Host only networking incomplete HWaddress

Discussions related to using VirtualBox on Linux hosts.

Host only networking incomplete HWaddress

Postby ndastur » 21. Jun 2011, 18:08

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?
ndastur
 
Posts: 17
Joined: 21. Jun 2011, 12:06
Primary OS: Linux other
VBox Version: PUEL
Guest OSses: Centos, Windows, OSX

Re: Host only networking incomplete HWaddress

Postby Martin » 21. Jun 2011, 23:51

Does the host also have an address in the 192.168.56.x network on the host only adapter vboxnet0?
Martin
Volunteer
 
Posts: 808
Joined: 30. May 2007, 18:05
Primary OS: Fedora 18
VBox Version: PUEL
Guest OSses: XP, Win7, Linux, OS/2

Re: Host only networking incomplete HWaddress

Postby ndastur » 22. Jun 2011, 12:56

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
ndastur
 
Posts: 17
Joined: 21. Jun 2011, 12:06
Primary OS: Linux other
VBox Version: PUEL
Guest OSses: Centos, Windows, OSX

Re: Host only networking incomplete HWaddress

Postby Martin » 22. Jun 2011, 13:49

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"
Martin
Volunteer
 
Posts: 808
Joined: 30. May 2007, 18:05
Primary OS: Fedora 18
VBox Version: PUEL
Guest OSses: XP, Win7, Linux, OS/2

Re: Host only networking incomplete HWaddress

Postby ndastur » 22. Jun 2011, 13:57

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
ndastur
 
Posts: 17
Joined: 21. Jun 2011, 12:06
Primary OS: Linux other
VBox Version: PUEL
Guest OSses: Centos, Windows, OSX

Re: Host only networking incomplete HWaddress

Postby mschwartz » 23. Jun 2011, 16:08

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
mschwartz
 
Posts: 92
Joined: 18. Oct 2010, 21:01
Primary OS: MS Windows 7
VBox Version: PUEL
Guest OSses: ubuntu

Re: Host only networking incomplete HWaddress

Postby ndastur » 23. Jun 2011, 16:38

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.
ndastur
 
Posts: 17
Joined: 21. Jun 2011, 12:06
Primary OS: Linux other
VBox Version: PUEL
Guest OSses: Centos, Windows, OSX

Re: Host only networking incomplete HWaddress

Postby Y E T I » 23. Jun 2011, 17:04

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
Y E T I
 
Posts: 161
Joined: 9. Aug 2010, 01:47
Location: H i m a l a y a s
Primary OS: Other
VBox Version: OSE self-compiled
Guest OSses: ?

Re: Host only networking incomplete HWaddress

Postby ndastur » 23. Jun 2011, 19:33

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
ndastur
 
Posts: 17
Joined: 21. Jun 2011, 12:06
Primary OS: Linux other
VBox Version: PUEL
Guest OSses: Centos, Windows, OSX

Re: Host only networking incomplete HWaddress

Postby ndastur » 23. Jun 2011, 20:49

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?
ndastur
 
Posts: 17
Joined: 21. Jun 2011, 12:06
Primary OS: Linux other
VBox Version: PUEL
Guest OSses: Centos, Windows, OSX


Return to VirtualBox on Linux Hosts

Who is online

Users browsing this forum: No registered users and 15 guests