For some tests, I needed multicast to work between some virtual machines in Virtualbox, here are the steps I follow to have it enable. My guest OS is CentOs7.
In the network tab, add a new card with type internal network, and in the advanced option set the promiscuous mode to “allow all VMs”
tell that the new card is recognized as
ip addr show
enp0s9, so under
/etc/sysconfig/network-scripts, create a file
ifcfg-enp0s9with the following content:
TYPE=Ethernet PROXY_METHOD=none BROWSER_ONLY=no BOOTPROTO=none IPADDR=192.168.57.11 PREFIX=24 DEFROUTE=no IPV4_FAILURE_FATAL=yes NAME=enp0s9 UUID=e280c669-e4fd-4a60-adb0-2d8d9c1015f0 DEVICE=enp0s9 ONBOOT=yes
(adapt to your need)
route-enp0s9 file containing:
220.127.116.11/4 via 192.168.57.11 dev enp0s9
This is to say the multicast traffic has to be routed on the internal network interface.
Then restart the network:
sudo systemctl restart network
Some kernel parameters has to be updated, edit the file
/etc/sysctl.d/99-sysctl.conf and add the lines:
sudo sysctl -p
And voilà, multicast should work between the VMs configured this way.