I am trying to create a simulated VLAN using socket networking, and the only way to connect multiple VMs in one network in QEMU using socket networking is by using the multicast mcast
option of the socket
network backend, to create a shared BUS.
However, when I try to use the following arguments in QEMU to create a multicast socket network:
-device e1000,netdev=sock-0 -netdev id=sock-0,mcast=230.0.0.1:1234
it fails with:
can't bind ip=230.0.0.1 to socket: Unknown error
in my Windows host.
Is this is a QEMU bug, or am I missing a prerequisite before running the QEMU command (such as expecting a multicast listener running, ...etc.)?
By the way, I am using Windows 10, and running a cross-compiled QEMU 4.2.0. I printed the error right before the failure on bind in net/socket.c
of the QEMU source code in line 256, and WSAGetLastError
returns WSAEADDRNOTAVAIL
.