I'm a linux beginner and trying to test multicast with socat on Ubuntu which works.
A bit "too well" actually (or I'm misunderstanding something fundamental)
my network looks that (ifconfig, abbreviated)
ens33 - 192.168.2.10 lo - 127.0.0.1 vboxnet0 - 5 - 192.168.56.1 and up to 192.168.1.1 vboxnet6 - 192.168.1.1 vboxnet7 - 10.0.1.1 vboxnet8 - 192.88.99.1 I start socat in two consoles like that
receiver
socat -d -d UDP-RECVFROM:6666,ip-add-membership=233.168.0.100:192.68.56.1:ens33,fork EXEC:hostname
sender
socat -d -d STDIO UDP4-DATAGRAM:233.18.0.100:6666,range=192.168.56.100/30
It doesn't matter what I choose as multicast address, as long as they match.
And I have to specify the interface on the receiver side for it to work.
Like I said at the beginning the receiver receives messages and that's the problem.
If I'm not mistaken it shouldn't because it is not i the defined range of 192.168.56.100/30 which translates to 192.168.56.101 - 192.168.56.103
the receiver always receives packages no matter what IP.
Am I misunderstanding what range actually does?
What am I missing?
I suspect it has something to with being on the same device (routing).