I am having an issue where mDNS responses are being dropped by my DL-WRX36 running OpenWrt 23.05.3.
I have an RPI5 server with a static IP address running home assistant and advertising some services using avahi. When I run avahi-browse on my laptop, the RPI5 receives the mDNS request and sends a valid response (verified using wireshark) which openwrt also receives (verified using tcpdump + wireshark locally) but my laptop never receives the response (again verified using wireshark). This behavior occurs regardless of whether my laptop is connected by ethernet or over wifi. I have also verified that udp multicast is enabled over wifi (and this also wouldn't affect the wired test).
I'm not really sure what to try next. My only suspicion is that since the RPI5 has a static IP the router knows to send the multicast packet to it and maybe there's something wrong with my DHCP setup but that also seems likely not the case since pings to the RPI5 and TCP/UDP connections otherwise work fine. For some added context, I removed dnsmasq and am using unbound + odhcpd.
Would appreciate any tips / ideas on how to debug this. I'm relatively new to OpenWrt so apologies in advance if anything is unclear or I forgot to mention something!
Did you set the static IP address on the Pi or on the router via ARP? I found that unless I allowed Network Manager to pick up the IP via DHCP I had problems. I don’t remember exactly what issue I was having but setting it on the router via ARP solved my issue.
I say this as someone with a Raspberry Pi 4 who has no problems with mDNS… even have a reflector running between 2 subnets without issue.
I added the RPI as a host to my /etc/config/dhcp and the RPI picks up the IP through DHCP as normal. I didn't manually set anything on the RPI so it isn't even aware that it has a static IP. Here is my dhcp config:
config host
option name 'rpi'
option mac 'XX:XX:XX:XX:XX:XX'
option ip '192.168.1.2'
I didn’t do anything special to get basic mDNS responses between two devices on the same subnet using dnsmasq. It works out-of-the-box. Did you have this problem with dnsmasq too or did you immediately remove it and install unbound? That might be as good a place to start as any.
I just reset the router, set the hostname, added a wireless network and repeated the same experiment.
On wifi, we get the same behavior: RPI gets the mDNS requests, router gets the mDNS response from the RPI and then the packet disappears into the void.
However when connected by ethernet, mDNS is back to normal, and this is without setting a static IP for the RPI through openwrt.
Here's some really interesting behavior. I tried switching the SSID name so that my iPhone would generate a new private MAC address and rerun DHCP without anything cached and mDNS worked. When I switched the SSID back to the original one and reconnected, mDNS broke again. The really interesting part is that I used a brand new SSID for these experiments so I believe my iPhone shouldn't use any cached DHCP leases from before I reset the router. I tried switching the SSID back and forth again and the same thing happened.
I suspected it had something to do with the DHCP lease stuff so I started playing with those settings and now no matter what I do it seems to work, but I've now reverted everything back to default and I can't seem to break it again.
Does this bizarre behavior exist when the Pi 5 is removed from the network? The Pi 5 is relatively new and the Raspberry Pi devices have been known to have teething problems.
My only suggestion would be to update the eeprom on your Pi.
I wasn't able to simulate the behavior without the PI on the network because now mDNS is seemingly working fine . I want to believe the theory that the PI is causing trouble, but the mDNS response multicast packets were received by the router from the PI and they looked right making me think otherwise so really not sure what was happening.
I'm a bit sad to leave things as is, but I'm not sure how to break it again so let's see if someone else encounters a similar issue and spots something I may have missed.
what is the value of multicast to unicast on your dl-wrx36?
if you see this again, could you try setting this to true and restart the radio. this all sounds very similar to issues that I have seen, unfortunately it reoccurs for me regularly