1

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 224.0.0.251 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 192.168.1.255 packets come through without issue.

I can look in ip maddr show and see

3:      tap0
        inet  224.0.0.251

If I use a regular C socket, and send data to 224.0.0.251, 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.

[Match]
Name=tap0

[Network]
DNS=127.0.0.67
Domains=local
DHCP=yes
Multicast=yes
MulticastDNS=yes
LLMNR=no

It is visible in ifconfig

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

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?

4
  • Since sending multicast packets could bork the network, it requires sudo: echo "hello" | sudo nc -u 224.0.0.251 5354 -w 1 Commented Jun 5, 2024 at 0:02
  • All commands above are executed as root. Commented Jun 5, 2024 at 2:25
  • Multicast does not require root. Can you try adding a route? sudo ip route add 224.0.0.0/4 dev tap0? Commented Jun 5, 2024 at 14:01
  • If I add that route, it does work, but then it only works for that specific interface. But, honestly, in my case, that's good enough. I'd still like to "fix it" but maybe make that an answer and I could checkmark it. Commented Jun 5, 2024 at 17:43

1 Answer 1

2

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

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

You must log in to answer this question.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.