This is not the same as How to multicast send to all network interfaces? which asks for a solution that would work in one program only, and requires source access - which I don't have.
I have a bunch of programs producing multicast traffic that I would like to see on my network, both wifi and ethernet, but I would also like them not to die from a "no route" when the network fails.
So what I really would like is to route all multicast traffic from a machine to all available interfaces, or to loopback if there are no interfaces up.
On Linux I can say:
sudo ifconfig lo multicast
sudo route add -net 224.0.0.0 netmask 240.0.0.0 dev lo
But this means that people using eth0 or wlan0 can't get the multicasts.
Similarly I can say:
sudo ifconfig lo multicast
sudo route add -net 224.0.0.0 netmask 240.0.0.0 dev eth0
But then wlan0 won't get the multicast. Worse, my programs just crash with a "no route to [whatever multicast ip]" if all interfaces go down.
How do I route things so that they go to all adaptors, including loopback?