teawolf
Posts: 3
Joined: Sat Dec 22, 2018 4:23 pm

No Multicast in an access point

Wed Jan 09, 2019 10:45 am

Hi,

I'm facing problems with multicast when setting up my Raspberry Pi 3b+ with Raspbian Stretch as an access point. Everything seems to be set up fine. I can ping multicast from another computer in the access point and the Raspberry Pi sends a response.

Code: Select all

[email protected]:~$ ping 224.0.0.1
PING 224.0.0.1 (224.0.0.1) 56(84) bytes of data.
64 bytes from 10.0.0.20: icmp_seq=1 ttl=64 time=0.135 ms
64 bytes from 10.0.0.2: icmp_seq=1 ttl=64 time=2.15 ms (DUP!)
64 bytes from 10.0.0.20: icmp_seq=2 ttl=64 time=0.088 ms
64 bytes from 10.0.0.2: icmp_seq=2 ttl=64 time=2.34 ms (DUP!)
64 bytes from 10.0.0.20: icmp_seq=3 ttl=64 time=0.126 ms
64 bytes from 10.0.0.2: icmp_seq=3 ttl=64 time=2.57 ms (DUP!)
^C
--- 224.0.0.1 ping statistics ---
3 packets transmitted, 3 received, +3 duplicates, 0% packet loss, time 2003ms
rtt min/avg/max/mdev = 0.088/1.238/2.574/1.129 ms
Here 10.0.0.20 is my PC and 10.0.0.2 is my Raspberry Pi which hosts the AP. So far so good.

If I try it the other way around I get :

Code: Select all

[email protected]:~ $ ping 224.0.0.1
connect: Network is unreachable
I set up the access point as described in: https://www.raspberrypi.org/documentati ... s-point.md

Code: Select all

cat /proc/sys/net/ipv4/icmp_echo_ignore_broadcasts
reads back a 0 on both devices.

When I connect the Raspberry Pi with a regular wifi network I can ping multicast and get a response from each device. So I am pretty sure the access point is faulty in some way.
Maybe I have to change something in /etc/hostapd/hostapd.conf? I tried to find something regarding the hotspot setup but found nothing.

I don't know if it matters that the AP is supposed to be local only. I am not interested to connect to the internet in some way.

I appreciate every help with this as I am a real newbie regarding network issues.

Thanks in advance!

EDIT: I just connected a second Raspberry Pi 3b+ with identical settings to the access point and tried to ping 224.0.0.1. I expected it to work just like the ping from my PC. In fact I got the same error message as with the other Raspberry Pi. Just to make it clear

Raspberry Pi: Can ping multicast in home wifi, cannot ping multicast in access point
HP-Laptop(running Ubuntu 16.04): Can ping multicast in home wifi, can ping multicast in access point and gets response from RPi's

Seems like this is an Raspbian/Debian issue? But then is the question why does it work connected to my wifi but not if connected to the access point?

teawolf
Posts: 3
Joined: Sat Dec 22, 2018 4:23 pm

Re: No Multicast in an access point

Wed Jan 09, 2019 5:50 pm

I was able to figure it out and will write it down for others who are facing the same problem. I do still not really understand what was the problem but it seems to work now.
Typing

Code: Select all

route -n
showed me a destination for my ip address range but apparently that was not enough.
I had to type

Code: Select all

sudo route add -net 224.0.0.0 netmask 224.0.0.0 wlan0
to add multicast routing for wlan0 in my ad hoc network.

I suppose the router or something takes care of it, if I am in a regular wifi network. Anyway, for now I am just happy that it works and will investigate later what was the real issue.

EDIT:
The route program is obsolete. Use ip instead. E.g.

Code: Select all

sudo ip route add 224.0.0.0/4 dev wlan0

Return to “Networking and servers”