What's new
  • SNBForums Code of Conduct

    SNBForums is a community for everyone, no matter what their level of experience.

    Please be tolerant and patient of others, especially newcomers. We are all here to share and learn!

    The rules are simple: Be patient, be nice, be helpful or be gone!

mDNs / Bonjour / Multicast

Mostly, but Apple devices default to that for other services as well (airplay, airprint are a couple of examples).

Also recall also that Win10 uses mDNS for resource discovery as well (along with all the other methods)... Also Linux makes significant use of avahi services, at least with Ubuntu and clones (and it's in every major repo/distro).

Anyways - libnss is already in AsusWRT, it's just missing the libnss-mdns library... in my private exploration of the WiFi bug I mentioned some time back, I dropped libnss-mdns into my private builds, as it made testing much easier...

IIRC - the library might be in Entware if memory serves me right...

But in reality the router doesn't need to support it at all for those other things, they communicate directly. The router having time machine backup to USB support makes sense that they would need it for that.

It would also be needed to support it between guest wireless and main LAN when access intranet is disabled, but having that disabled breaks it anyway so it wouldn't help there.
 
Not sure why libnss-mdns would be necessary. Wouldn't most (or all?) mDNS queries be for services not hostname resolution? I don't run any services (such as smb) on my router, but I assume the avahi-daemon is there to respond to mDNS queries for services actually running on the router. I would think queries for hostname resolution would be unicast DNS. What if mDNS hostname does not equal DNS hostname?
 
Not sure why libnss-mdns would be necessary. Wouldn't most (or all?) mDNS queries be for services not hostname resolution? I don't run any services (such as smb) on my router, but I assume the avahi-daemon is there to respond to mDNS queries for services actually running on the router. I would think queries for hostname resolution would be unicast DNS. What if mDNS hostname does not equal DNS hostname?

As far as I've seen all that discovery/response traffic uses the .local hostname so relies on mDNS and doesn't use DNS at all. In a way it makes sense as not all home routers support(ed) local DNS, or aren't configured properly for it to work well, etc. So the theory was to avoid that all together.
 
Update for those interested:

I am running the iOS 17 beta (time of writing Developer Beta 5). I decided to nuke my old Home (and use a home reset profile provided by Apple) to clear all existing iCloud Home existence and start from scratch.

I setup a new Home and I added my 3 HomePods back (on 5GHz Wi-Fi), it's been a day so far and I have to say they have been working flawlessly with not even a hint of a glitch, music plays back fast, Siri responses are good and always work, AirPlay works to them reliably from my iPhone.

I always thought this was a Home / HomePod / Apple bug and I don't believe the router (ASUS GTAX6000 running rMerlin 3004.388.4 beta 3) has much of an effect, but I wondered if there was anything on the router settings that should or should not be on etc to improve something like this, however I have changed a few settings on my Router, now what difference this has made I don't know, but I am happy to report it is running perfectly.

I did not have too many Home devices so nuking my Home and setting is back up is not much of an issue, and will add devices slowly and see how it goes.

Screenshot 2023-08-17 at 08.43.56.png
Screenshot 2023-08-17 at 08.44.06.png

Screenshot 2023-08-17 at 08.44.29.png
 
Asus routers still run Netatalk (Apple Share File Protocol) for Apple service discovery... AFP has been deprecated for years now, and with Apple Silicon, it's basically not supported.

They have limited Avahi support - Avahi being Bonjour/Rendezvous for Apple devices.

Asus is missing a specific library that would improve things - libnss-mdns

I've mentioned this in the past to @RMerlin - challenge here is that it's hard to test unless one has multiple Apple devices, or devices that support MultiCast DNS for service discovery.

Adding NSS-MDNS is actually trivial, as NSS is already implemented on AsusWRT...

 
With 3006 FW comes the ability to add VLANs, but with separate subnets comes a whole new set of headaches... I have discovered mDNS (or the lack of it).
I use Home Assistant and to date my IoT devices have been on the same subnet (different SSID) as the Primary Network.

Changing the VLAN subnet has caused a few issues with devices being 'seen' across the networks (ESP32 devices going offline, TPLink Plugs not being recognised...) and everything I read points to mDNS being the magic pill. So how do we go about implementing mDNS for dummies?

This is a whole new ballgame for me, and the threads I have seen on it with ColinTaylors guidance to robca, essentially note this as the first of two phases to get mDNS going:
  • add the file avahi-daemon.conf.add to /jffs/configs/
  • add this line in it under the [bracketed] heading shown

    [reflector]
    enable-reflector=yes
  • restart the daemon by issuing
    Code:
    service restart_mdns
  • check the same lines as above are in the avahi-damon.conf file in /tmp/avahi/avahi-daemon.conf
However, the second phase is where it all gets complicated for my feeble brain, with iptables etc...

So if as SFX2000 notes, 'Adding NSS-MDNS is actually trivial, as NSS is already implemented on AsusWRT...', then I would really, really love to see it as a selectable option in Merlin sometime.

k.
[TYPO in the /jffs/configs path]
 

Attachments

  • 01.jpg
    01.jpg
    32.8 KB · Views: 34
  • 02.jpg
    02.jpg
    83.9 KB · Views: 31
  • 04.jpg
    04.jpg
    39.9 KB · Views: 30
  • 03.jpg
    03.jpg
    76.2 KB · Views: 28
  • 05.jpg
    05.jpg
    82.4 KB · Views: 47
Last edited:
I finally just gave up on getting multicast (avahi) working on my be96u. I ended up dual-homing my homebridge server and enabling the reflector on it. Once I did that everything just started working, homekit, bonjour, sonos, etc... I may revisit again at some point, but for now it will do.
 
I struggled with HomeKit and Apple devices and HomePods in particular for years using asus routers (not a Merlin issue).

Built my own router using a minipc and opnsense. Run all my asus routers as access points.

Now and finally everything just works perfectly all the time. It is night and day better.
 
So if as SFX2000 notes, 'Adding NSS-MDNS is actually trivial, as NSS is already implemented on AsusWRT...', then I would really, really love to see it as a selectable option in Merlin sometime.
Adding this would not solve the issues people were having (as was repeatedly explained to sfx2000 in this and other threads). RMerlin added libnss-mdns support in 3004.388.8 and nothing changed (as expected).
 
With 3006 FW comes the ability to add VLANs, but with separate subnets comes a whole new set of headaches... I have discovered mDNS (or the lack of it).
I use Home Assistant and to date my IoT devices have been on the same subnet (different SSID) as the Primary Network.

Changing the VLAN subnet has caused a few issues with devices being 'seen' across the networks (ESP32 devices going offline, TPLink Plugs not being recognised...) and everything I read points to mDNS being the magic pill. So how do we go about implementing mDNS for dummies?

This is a whole new ballgame for me, and the threads I have seen on it with ColinTaylors guidance to robca, essentially note this as the first of two phases to get mDNS going:
  • add the file avahi-daemon.conf.add to /jffs/config/
  • add this line in it under the [bracketed] heading shown

    [reflector]
    enable-reflector=yes
  • restart the daemon by issuing
    Code:
    service restart_mdns
  • check the same lines as above are in the avahi-damon.conf file in /tmp/avahi/avahi-daemon.conf
However, the second phase is where it all gets complicated for my feeble brain, with iptables etc...

So if as SFX2000 notes, 'Adding NSS-MDNS is actually trivial, as NSS is already implemented on AsusWRT...', then I would really, really love to see it as a selectable option in Merlin sometime.

k.
Hi,
Long time merlin user here, just recently created a account.
Coming from RT-AC86U now when it's EOL, had everything working great on 386.14_2 at home. No issues with chromecast. Upgraded to RT-BE86U with latest merlin fw, 3006.102.4_beta1 and _almost_ everything is working great :) I've been ripping my hair out, trying to get chromecast working again. Tried everything from enabling IGMP routing, enabling the built-in itunes and media servers to different settings in the wireless professional tab. Super-simple network with just the one router, a media bridge and couple of servers connecting via cable but for the most part wifi devices.
I've a few devices, both speakers with built-in cast and a couple of chromecast audios with rooms configured etc etc, all running on 2.4GHz for simplicity so I can turn off all the bells and whistles with wifi 6/7 and such. I keep those new features for 5GHz.
So I have spent sooooo many hours on this, and the one thing that finally solved it was this, enable-reflector=yes, so thank you so much for those simple instructions on how to utilize /jffs/config/ and avahi-daemon.conf.add to get this working. I could even go back on all the other settings I dabbled with, ie. back to "default" settings and chromecast is working like a charm.
Also of course, big thanks to all other people that have hinted about this setting, I've read so many threads I don't remember all the names.
 
the one thing that finally solved it was this, enable-reflector=yes, so thank you so much for those simple instructions on how to utilize /jffs/config/ and avahi-daemon.conf.add to get this working. I could even go back on all the other settings I dabbled with, ie. back to "default" settings and chromecast is working like a charm.
Really pleased it worked out for you, the irony for me being I don't think I actually pursued it after I started putting my VLANs together, possibly because I put the HA Server on the same VLAN as the IoT Devices and possibly because I set the Access Intranet to "Main Network", so we will never know :-).
Also of course, big thanks to all other people that have hinted about this setting, I've read so many threads I don't remember all the names.
That would be @ColinTaylor; the man has an encyclopedic knowledge of this FW, the various interactions between elements of it and sometimes the spooky ability to recall who wrote what in which thread.
 

Attachments

  • IoT_Access_Intranet.jpg
    IoT_Access_Intranet.jpg
    38.8 KB · Views: 31
I have moved my post from the Avahi thread as recommended by Colin, to here. See also some background here.

I continue to be unable to Cast from my Primary Network to my IoT Network, despite the same working from Guest to IoT. mDNS on AsusWRT appears to be a two part solution,(I) enable the Avahi refector discussed on the Avahi thread and (II) Enable connectivity between the two subnets. This post focuses primarily on (II).

Checking for services:

I didn't install avahi-utils (so as to use avahi-browse) as it seemed to want to install other stuff and I wanted to keep my router simple.

What I did do was install an App called Discovery -ns-sd browser which showed me the following services for my 3 Networks, SmurfNET (br0), SmurfNETGuest (br52), SmurfIoT (br53)


Over the last week and a bit I have done more reading about trying to get Chromecast to work over subnets than I cared to and I cannot get any further on my Primary-IoT interface. Casting works fine on Guest-IoT, I do not know why. It's a huge topic spanning at least 10 years, with a few generic "solutions", none of which I can make work.

Most posts refer to:
  • (i) Setting an avahi reflector (per Colin's post) and (ii) Forwarding UDP Port 5353 / Port 1900
Some refer to doing these amendments; none worked for me:
  • Disabling IGMPv3 Snooping; did not work for me.
  • use-ipv6=yes in avahi-daemon.conf
  • allow-interfaces=[defined list]; see above
I have put these in firewall-start in /jffs/scripts
Code:
# Added by KM to allow User access to Chromecast with Google TV from any client on the Primary Network
iptables -I FORWARD -i br0 -s 192.168.9.0/24 -d 192.168.53.239 -j ACCEPT
iptables -I FORWARD -i br53 -s 192.168.53.239 -d 192.168.9.0/24 -j ACCEPT

I have tried these port lines:

Code:
iptables -I INPUT -p udp -d 224.0.0.251 --dport 5353 -j ACCEPT

Code:
iptables -I INPUT -i br0 -p udp -m multiport --dport 5353 -j ACCEPT
iptables -I FORWARD -i br0 -p udp -m multiport --dport 5353 -j ACCEPT

Code:
iptables -I INPUT -p udp --dport 1900 -i br0 -j ACCEPT
iptables -I INPUT -p udp --dport 1900 -i br53 -j ACCEPT
iptables -I FORWARD -p udp --dport 5353 -i br0 -j ACCEPT
iptables -I FORWARD -p udp --dport 5353 -i br53 -j ACCEPT
iptables -I INPUT -p udp --dport 5353 -i br53 -j ACCEPT
iptables -I INPUT -p udp --dport 5353 -i br0 -j ACCEPT
# Increase IP TTL so it can go an extra hop
iptables -t mangle -A PREROUTING -d 239.255.255.250 -j TTL --ttl-inc 1
iptables -t mangle -A PREROUTING -d 224.0.0.251 -j TTL --ttl-inc 1

Code:
iptables -A FORWARD -m state --state RELATED,ESTABLISHED -j ACCEPT
iptables -A FORWARD -i br0 -o br+ -j ACCEPT
iptables -I INPUT -i br53 -p udp --dport 5353 -j ACCEPT

Got outputs from various posts:
Code:
Smurf65@RT-AX88U-Pro:/tmp/home/root# find / -print | grep -i -e mdns -e avahi
/jffs/configs/avahi-daemon.conf.add
/tmp/avahi
/tmp/avahi/avahi-daemon.conf
/tmp/avahi/services
/tmp/avahi/services/alexa.service
/usr/lib/libavahi-common.so.3
/usr/lib/libavahi-common.so.3.5.4
/usr/lib/libavahi-core.so.7
/usr/lib/libavahi-core.so.7.1.0
/usr/lib/libnss_mdns4.so.2
/usr/lib/libnss_mdns4_minimal.so.2
/usr/sbin/avahi-daemon
/var/run/avahi-daemon
/var/run/avahi-daemon/socket
/var/run/avahi-daemon/pid

Smurf65@RT-AX88U-Pro:/tmp/home/root#ps w | grep -i mdns
1806 Smurf65   5976 S    grep -i mdns

I am all out of ideas. Anyone ?
 

Attachments

  • IMG_2068.jpeg
    IMG_2068.jpeg
    5.3 KB · Views: 2
  • IMG_2069.jpeg
    IMG_2069.jpeg
    85.9 KB · Views: 1
  • IMG_2070.jpeg
    IMG_2070.jpeg
    41.8 KB · Views: 1
  • IMG_2071.jpeg
    IMG_2071.jpeg
    103 KB · Views: 1
  • IMG_2072.jpeg
    IMG_2072.jpeg
    105.9 KB · Views: 1
@jksmurf, not sure in your many posts about your issue if you have posted your various Guest Network Pro Profile settings for each of the Profiles you have created. If you haven't it might help to post them for others to review in case there is a specific issue with the IoT Profile.

Also don't know if I've seen you indicate it yet but have you tried putting the Chromecast device on a Guest Network Pro Profile other than the IoT Profile as a troubleshooting step to see if the issue of main LAN to Chromecast persists?
 
Similar threads
Thread starter Title Forum Replies Date
I mDNS on different subnets via VPN Asuswrt-Merlin 4

Similar threads

Latest threads

Support SNBForums w/ Amazon

If you'd like to support SNBForums, just use this link and buy anything on Amazon. Thanks!

Sign Up For SNBForums Daily Digest

Get an update of what's new every day delivered to your mailbox. Sign up here!
Back
Top