Linux won't send multicast packets to interface

I have a server on VPN configured as a TAP device (as opposed to TUN, since it is joining to a wider network). I can send unicast traffic of that network, as well as receive multicast packets (and reply to them).

But, the issue comes when I send multicast packets. For instance, if I issue:

echo "hello" | nc -u 5354 -w 1

while watching

tcpdump -i tap0 -w test.pcap

No packets are sent.

But if I for instance say: echo "hello" | nc -ub packets come through without issue.

I can look in ip maddr show and see

3:      tap0

If I use a regular C socket, and send data to, no data appears in the packet capture or on the network.

For background – I am using debian with systemd, and I have enabled multicast on the interface.



It is visible in ifconfig

tap0: flags=4163<UP,BROADCAST,RUNNING,MULTICAST>  mtu 1500
        inet  netmask  broadcast

I also monitored /proc/net/dev and there are no packets or dropped packets going through tap0 when I try sending packets.

What am I missing? What needs to be different to send multicast packets on my interface?

Asked By: Charles Lohr


It’s probably because the interface lacks a route to do multicasting on.

Try sudo ip route add dev tap0 to add the multicast route to tap0 device.

Answered By: vidarlo