VirtualBox

Ticket #10593 (new defect)

Opened 2 years ago

Last modified 2 years ago

arp mac address collision if DHCP server has same IP as host-only adapter

Reported by: VirtualBox User Owned by:
Priority: major Component: network/hostif
Version: VirtualBox 4.1.16 Keywords:
Cc: Guest type: BSD
Host type: Linux

Description

My guest's network adapter is set to host-only mode. In File..Preferences..Network, if I modify my host-only adapter so that the IPv4 address matches the DHCP server address, arp requests from the guest will get two replies from two mac addresses: one from the host OS and one from the DHCP server.

Sometimes the guest OS will pick the mac address corresponding to the host. When this happens, networking works fine. When the guest OS picks the mac address corresponding to the DHCP server, networking stops working because packets destined to the host are sent to the wrong mac address.

My setup:

  • VirtualBox 4.1.16
  • host Linux (Ubuntu 12.04 Precise) amd64
  • guest NetBSD 6.0_BETA i386
  • host-only networking

Change History

comment:1 follow-up: ↓ 2 Changed 2 years ago by aleksey

Let's make sure we are talking the same thing: you put the same IP address in "IPv4 Address" field on "Adapter" page and in "Server Address" field on "DHCP Server" page in "Host-only Network Details" dialog window? And why would you do this? Assigning the same IP to two computers on the network is not a good idea, even if these "computers" are virtual.

comment:2 in reply to: ↑ 1 Changed 2 years ago by VirtualBox User

Replying to aleksey:

Let's make sure we are talking the same thing: you put the same IP address in "IPv4 Address" field on "Adapter" page and in "Server Address" field on "DHCP Server" page in "Host-only Network Details" dialog window?

Yes.

And why would you do this? Assigning the same IP to two computers on the network is not a good idea, even if these "computers" are virtual.

It was unclear to me that the DHCP server would be a separate virtual device. I was expecting the DHCP server to be a process (e.g., dnsmasq) running on the host machine and bound to the vboxnet0 interface. If that was the case, why would I want the IP address to be different?

comment:3 Changed 2 years ago by aleksey

I see your point. Although DHCP server essentially is a host process, it "connects" to VirtualBox internal "switch" almost just like any other VM network adapter. It also has its own MAC address. A host-only interface, in fact, represents a network to which all VM network adapters attached to the same host-only interface connect. Our DHCP server "connects" to this virtual network.

comment:4 Changed 2 years ago by VirtualBox User

Would you be willing to add that explanation to the dialog box so that people understand how it works? Or maybe raise an error if the two IP addresses equal each other, and have that explanation be in the error message text?

Note: See TracTickets for help on using tickets.

www.oracle.com
ContactPrivacy policyTerms of Use