[WorksForMe] UDP broadcast on host-only networks?

Discussions about using Linux guests in VirtualBox.
Post Reply
tarkvara
Posts: 3
Joined: 17. Aug 2018, 17:28

[WorksForMe] UDP broadcast on host-only networks?

Post by tarkvara »

Greetings,

We're using VirtualBox to test a suite of Java servers which communicate with each other using UDP. The host is MacOSX and the guest VMs are running CentOS.

If VM #1 (192.168.56.101) does a UDP send to VM #2 (192.168.56.102), the packet is received.

If VM #1 does a UDP broadcast (192.168.56.255) the packet is never received by VM #2 (confirmed by checking that the RX packet count in ifconfig is not incremented).

The configuration returned by ifconfig looks like this:
eth0      Link encap:Ethernet  HWaddr 08:00:27:8C:1B:8E  
          inet addr:192.168.56.101  Bcast:192.168.56.255  Mask:255.255.255.0
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
          RX packets:23165 errors:0 dropped:0 overruns:0 frame:0
          TX packets:4107 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000
Are there any known issues with UDP broadcast on VirtualBox host-only networks? If this should be something that works in VirtualBox, what sort of configuration issues might be preventing it from working?

Thanks,

Eric Smith
Last edited by socratis on 28. Aug 2018, 19:01, edited 2 times in total.
Reason: Marked as [WorksForMe].
socratis
Site Moderator
Posts: 27329
Joined: 22. Oct 2010, 11:03
Primary OS: Mac OS X other
VBox Version: PUEL
Guest OSses: Win(*>98), Linux*, OSX>10.5
Location: Greece

Re: UDP broadcast on host-only networks?

Post by socratis »

From the address scheme, it seems that you're using the HostOnly networking option. Could you try with a couple more as a test? "Internal" and "NATservice"?

You will need to either create a DHCP server for the "Internal" option, or add a "NATservice" network in the VirtualBox preferences. The latter also includes a DHCP server option in the GUI, so you might find it easier than manually creating a DHCP server for the "Internal" network.

Your other option, if you use "Internal" without the DHCP server, would be to manually assign static IP addresses, netmasks and the rest of the IP configuration.
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.
tarkvara
Posts: 3
Joined: 17. Aug 2018, 17:28

Re: UDP broadcast on host-only networks?

Post by tarkvara »

Hi,

Per your suggestions, we tried "NAT Service" (with DHCP server) and saw the same lack of propagation for UDP broadcasts. Then we tried "Internal" as well (adding a DHCP server with VBoxManage), and UDP broadcasts are also going nowhere. In both cases, the situation is exactly the same as with host-only network, with non-broadcast UDP packets being successfully received.

On additional data point. With host-only networking, I can view the packets with Wireshark, and Wireshark reports that the packets being broadcast get at least as far as the host (although they're not received by any guests).

I feel that there must be something simple that I'm missing here, but I don't know what.

Thanks,

Eric Smith
tarkvara
Posts: 3
Joined: 17. Aug 2018, 17:28

Re: UDP broadcast on host-only networks?

Post by tarkvara »

Turns out that the issue was a bug in the server software. We have a bug fix from the vendor, and now it works perfectly on host-only networks.

ADMINs: Feel free to delete this thread, since it will only serve to mislead future readers.
socratis
Site Moderator
Posts: 27329
Joined: 22. Oct 2010, 11:03
Primary OS: Mac OS X other
VBox Version: PUEL
Guest OSses: Win(*>98), Linux*, OSX>10.5
Location: Greece

Re: UDP broadcast on host-only networks?

Post by socratis »

tarkvara wrote:ADMINs: Feel free to delete this thread, since it will only serve to mislead future readers.
On the contrary, someone might find it very useful if they're in the same situation as you! ;)
So, if you can add any more details of what was the problem and how you got it fixed, the better...

Marking this as [WorksForMe] I guess...
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.
Post Reply