Multicast route to all interfaces
<p>This is not the same as <a href="https://stackoverflow.com/questions/10702870/how-to-multicast-send-to-all-network-interfaces">How to multicast send to all network interfaces?</a> which asks for a solution that would work in one program only, and requires source access - which I don't have.</p>

<p>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.</p>

<p>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. </p>

<p>On Linux I can say:</p>

<pre><code>sudo ifconfig lo multicast
sudo route add -net 224.0.0.0 netmask 240.0.0.0 dev lo
</code></pre>

<p>But this means that people using <strong>eth0</strong> or <strong>wlan0</strong> can't get the multicasts.</p>

<p>Similarly I can say:</p>

<pre><code>sudo ifconfig lo multicast
sudo route add -net 224.0.0.0 netmask 240.0.0.0 dev eth0
</code></pre>

<p>But then <strong>wlan0</strong> won't get the multicast. Worse, my programs just crash with a "no route to [whatever multicast ip]" if all interfaces go down.</p>

<p>How do I route things so that they go to all adaptors, including loopback?</p>