Socat multicast in Vagrant & VirtualBox Env

Problem . Each computer on the same network should be able to broadcast all the elements, including itself.

This is an attempt to get multicast socatwith virtual machines created in Vagrant and VirtualBox Envrionment. Everything seems to work differently here, so I first tried to see how multicast works on physical machines.

I have 3 physical computers with ubuntu 12.04 server installed on them and are called pc0, pc1and pc2.

On each machine, I run: socat STDIO UDP-DATAGRAM:224.0.0.1:2200,bind=:2200

... and when I dialed hi from pc0out pc0, he passed it to himself and the other 2 computers, and that is what I wanted (and I hope that this is how the multicast should work):

ubuntu@pc0:~$ socat STDIO UDP-DATAGRAM:224.0.0.1:2200,bind=:2200
hi from pc0
hi from pc0

ubuntu@pc1:~$ socat STDIO UDP-DATAGRAM:224.0.0.1:2200,bind=:2200
hi from pc0

ubuntu@pc2:~$ socat STDIO UDP-DATAGRAM:224.0.0.1:2200,bind=:2200
hi from pc0

I use IP 224.0.0.1as it is used by default for multicasting on every computer.

Then I tried to implement the same material with 3 virtual machines vb0, vb1and vb2. Github repo is here .

Now I tried passing from vb0:

vagrant@vb0:~$ socat STDIO UDP-DATAGRAM:224.0.0.1:2200,bind=:2200
hello from vb0
hello from vb0

... and it is not transferred to other members (as is the case with the physical machines above), except for itself.

There seems to be some additional settings that need to be done before this works ...

Vagrantfile:

Vagrant.configure(2) do |config|

    config.vm.box = "ubuntu-12.04-x64"
    config.vm.synced_folder ".", "/vagrant", disabled: true

    config.vm.provider "virtualbox" do |vb|
        vb.cpus    = "2"
        vb.memory = "4096"
    end

    config.vm.provision "chef_apply" do |chef|
        chef.recipe = File.read("recipe.rb")
    end

    config.vm.define "vb0" do |vb0|
        vb0.vm.hostname = "vb0"
        vb0.vm.network "private_network", ip: "10.20.30.100"
    end

    config.vm.define "vb1" do |vb1|
        vb1.vm.hostname = "vb1"
        vb1.vm.network "private_network", ip: "10.20.30.101"
    end

    config.vm.define "vb2" do |vb2|
        vb2.vm.hostname = "vb2"
        vb2.vm.network "private_network", ip: "10.20.30.102"
    end

end
+4
1

(.. vb01, vb1 vb2):

sudo ip route add 224.0.0.0/4 dev eth1

.

, . , , .

vagrant@vb0:~$ route
Kernel IP routing table
Destination     Gateway         Genmask         Flags Metric Ref    Use Iface
default         10.0.2.2        0.0.0.0         UG    100    0        0 eth0
10.0.2.0        *               255.255.255.0   U     0      0        0 eth0
10.20.30.0      *               255.255.255.0   U     0      0        0 eth1
224.0.0.0       *               240.0.0.0       U     0      0        0 eth1

http://troglobit.imtqy.com/multicast-howto.html

+3

All Articles