What's new

Help with Avahi mDNS redirector, please

  • 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!

robca

Regular Contributor
I'm trying to set up a mDNS reflector using avahi on Merlin 386.11 (RT-68U). My goal is to enable a WiiM device on a segregated IoT network (per https://www.snbforums.com/threads/mdns-repeater-with-guest-network-vlan.86503/)

I finally realized that Avahi is enabled by default, and I tried editing the /tmp/avahi/avahi-daemon.conf file to add the "[reflector] enable-reflector=yes" configuration. But upon restarting the service with "service restart_mdns", the avahi-daemon.conf file is reverted to the one before I edited it.

How can I edit the Avahi configuration? I even tried adding a /jffs/scripts/avahi-daemon.conf file, but that doesn't work

Can I do what I want (mDNS between vlans) using the built in Avahi, or do I need to follow this tutorial to enable it? https://www.linksysinfo.org/index.p...figuring-a-reflector-aka-mdns-repeater.75706/
 
Thanks @ColinTaylor . I actually tried using avahi-daemon.conf.add, and avahi-daemon.conf.postconf in /jffs/scripts (where I have other files). Those files are executable, but for some reason it still can't add the redirecto to the /tmp/avahi/avahi-daemon.conf file

Here's the content of my /jffs/scripts, in case I have a typo

Code:
admin@RT-AC68U-7BA8:/tmp/home/root# ls -la /jffs/scripts/
drwxr-xr-x    2 admin    root             0 Aug 27 15:26 .
drwxr-xr-x   13 admin    root             0 Aug 27 15:31 ..
-rwxrwxrwx    1 admin    root            33 Aug 27 14:52 avahi-daemon.conf.add
-rwxr-xr-x    1 admin    root            74 Nov 25  2018 dnsmasq.postconf
-rwxr-xr-x    1 admin    root          4831 Dec 30  2022 firewall-start
-rwxr-xr-x    1 admin    root            75 Feb 12  2020 post-mount
-rwxr-xr-x    1 admin    root           109 Jul 30  2022 service-event
-rwxrwxrwx    1 admin    root           962 Dec 26  2022 services-start
-rwxr-xr-x    1 admin    root            43 Feb 27  2019 services-stop
-rwxr-xr-x    1 admin    root            91 Jan 10  2018 smb.postconf
-rwxr-xr-x    1 admin    root           113 Feb 12  2020 unmount
-rwxr-xr-x    1 admin    root            11 Nov 25  2018 wan-start

I looked at the logs while I edited the /tmp/avahi/avahi-daemon.conf file, and I see the first 2 lines below (basically it notices that the file is changed and reloads it?)

I then executed the "service restart_mdns" and I see Avahi restart
Code:
Aug 27 15:37:54 avahi-daemon[2271]: Files changed, reloading.
Aug 27 15:37:54 avahi-daemon[2271]: No service file found in /tmp/avahi/services.

Aug 27 15:38:08 rc_service: service 2479:notify_rc restart_mdns
Aug 27 15:38:08 custom_script: Running /jffs/scripts/service-event (args: restart mdns)
Aug 27 15:38:08 avahi-daemon[2271]: Got SIGTERM, quitting.
Aug 27 15:38:08 avahi-daemon[2271]: Leaving mDNS multicast group on interface br1.IPv4 with address 192.168.20.1.
Aug 27 15:38:08 avahi-daemon[2271]: Leaving mDNS multicast group on interface br0.IPv4 with address 192.168.1.1.
Aug 27 15:38:08 avahi-daemon[2271]: Leaving mDNS multicast group on interface lo.IPv4 with address 127.0.1.1.
Aug 27 15:38:08 avahi-daemon[2271]: avahi-daemon 0.8 exiting.
Aug 27 15:38:09 avahi-daemon[2487]: Found user 'nobody' (UID 65534) and group 'nobody' (GID 65534).
Aug 27 15:38:09 avahi-daemon[2487]: Successfully dropped root privileges.
Aug 27 15:38:09 avahi-daemon[2487]: avahi-daemon 0.8 starting up.
Aug 27 15:38:09 avahi-daemon[2487]: WARNING: No NSS support for mDNS detected, consider installing nss-mdns!
Aug 27 15:38:09 avahi-daemon[2487]: No service file found in /tmp/avahi/services.
Aug 27 15:38:09 avahi-daemon[2487]: Loading new alias name RT-AC68U.
Aug 27 15:38:09 avahi-daemon[2487]: Joining mDNS multicast group on interface br1.IPv4 with address 192.168.20.1.
Aug 27 15:38:09 avahi-daemon[2487]: New relevant interface br1.IPv4 for mDNS.
Aug 27 15:38:09 avahi-daemon[2487]: Joining mDNS multicast group on interface br0.IPv4 with address 192.168.1.1.
Aug 27 15:38:09 avahi-daemon[2487]: New relevant interface br0.IPv4 for mDNS.
Aug 27 15:38:09 avahi-daemon[2487]: Joining mDNS multicast group on interface lo.IPv4 with address 127.0.1.1.
Aug 27 15:38:09 avahi-daemon[2487]: New relevant interface lo.IPv4 for mDNS.
Aug 27 15:38:09 avahi-daemon[2487]: Network interface enumeration completed.
Aug 27 15:38:09 avahi-daemon[2487]: Registering new address record for 192.168.20.1 on br1.IPv4.
Aug 27 15:38:09 avahi-daemon[2487]: Registering new address record for 192.168.1.1 on br0.IPv4.
Aug 27 15:38:09 avahi-daemon[2487]: Registering new address record for 127.0.1.1 on lo.IPv4.
Aug 27 15:38:09 avahi-daemon[2487]: Registering new address record for 127.0.0.1 on lo.IPv4.
Aug 27 15:38:10 avahi-daemon[2487]: Server startup complete. Host name is RT-AC68U-7BA8.local. Local service cookie is 2667339504.
Aug 27 15:38:10 avahi-daemon[2487]: Alias name "RT-AC68U" successfully established.

I even created a avahi-daemon.postconf like this

Code:
#!/bin/sh
CONFIG=$1
source /usr/sbin/helper.sh

pc_append "[reflector]" "enable-reflector=yes" $CONFIG

And I see it run in the log as follows

Code:
Aug 27 15:44:25 rc_service: service 3087:notify_rc restart_mdns
Aug 27 15:44:25 custom_script: Running /jffs/scripts/service-event (args: restart mdns)
Aug 27 15:44:25 avahi-daemon[2487]: Got SIGTERM, quitting.
Aug 27 15:44:25 avahi-daemon[2487]: Leaving mDNS multicast group on interface br1.IPv4 with address 192.168.20.1.
Aug 27 15:44:25 avahi-daemon[2487]: Leaving mDNS multicast group on interface br0.IPv4 with address 192.168.1.1.
Aug 27 15:44:25 avahi-daemon[2487]: Leaving mDNS multicast group on interface lo.IPv4 with address 127.0.1.1.
Aug 27 15:44:26 avahi-daemon[2487]: avahi-daemon 0.8 exiting.
Aug 27 15:44:26 custom_script: Running /jffs/scripts/avahi-daemon.postconf (args: /tmp/avahi/avahi-daemon.conf)
Aug 27 15:44:26 avahi-daemon[3096]: Found user 'nobody' (UID 65534) and group 'nobody' (GID 65534).
Aug 27 15:44:26 avahi-daemon[3096]: Successfully dropped root privileges.
Aug 27 15:44:26 avahi-daemon[3096]: avahi-daemon 0.8 starting up.
Aug 27 15:44:26 avahi-daemon[3096]: WARNING: No NSS support for mDNS detected, consider installing nss-mdns!
Aug 27 15:44:26 avahi-daemon[3096]: No service file found in /tmp/avahi/services.
Aug 27 15:44:26 avahi-daemon[3096]: Loading new alias name RT-AC68U.
Aug 27 15:44:26 avahi-daemon[3096]: Joining mDNS multicast group on interface br1.IPv4 with address 192.168.20.1.
Aug 27 15:44:26 avahi-daemon[3096]: New relevant interface br1.IPv4 for mDNS.
Aug 27 15:44:26 avahi-daemon[3096]: Joining mDNS multicast group on interface br0.IPv4 with address 192.168.1.1.
Aug 27 15:44:26 avahi-daemon[3096]: New relevant interface br0.IPv4 for mDNS.
Aug 27 15:44:26 avahi-daemon[3096]: Joining mDNS multicast group on interface lo.IPv4 with address 127.0.1.1.
Aug 27 15:44:26 avahi-daemon[3096]: New relevant interface lo.IPv4 for mDNS.
Aug 27 15:44:26 avahi-daemon[3096]: Network interface enumeration completed.
Aug 27 15:44:26 avahi-daemon[3096]: Registering new address record for 192.168.20.1 on br1.IPv4.
Aug 27 15:44:26 avahi-daemon[3096]: Registering new address record for 192.168.1.1 on br0.IPv4.
Aug 27 15:44:26 avahi-daemon[3096]: Registering new address record for 127.0.1.1 on lo.IPv4.
Aug 27 15:44:26 avahi-daemon[3096]: Registering new address record for 127.0.0.1 on lo.IPv4.
Aug 27 15:44:27 avahi-daemon[3096]: Server startup complete. Host name is RT-AC68U-7BA8.local. Local service cookie is 1601803446.
Aug 27 15:44:27 avahi-daemon[3096]: Alias name "RT-AC68U" successfully established.

But when I issue a cat /tmp/avahi/avahi-daemon.conf I see

Code:
[Server]
host-name=RT-AC68U-7BA8
aliases=RT-AC68U
aliases_llmnr=RT-AC68U
use-ipv4=yes
use-ipv6=no
deny-interfaces=eth0
ratelimit-interval-usec=1000000
ratelimit-burst=1000

[publish]
publish-a-on-ipv6=no
publish-aaaa-on-ipv4=no

[wide-area]
enable-wide-area=yes

[rlimits]
rlimit-core=0
rlimit-data=4194304
rlimit-fsize=0
rlimit-nofile=768
rlimit-stack=4194304
rlimit-nproc=3

I can't make sense of this...
 
Are those two lines/errors relevant?

Code:
Aug 27 15:38:09 avahi-daemon[2487]: WARNING: No NSS support for mDNS detected, consider installing nss-mdns!
Aug 27 15:38:09 avahi-daemon[2487]: No service file found in /tmp/avahi/services.
 
As per the wiki, .add files go in /jffs/configs. That's all you need, remove any other files you've made. Then reboot the router or restart avahi (service restart_mdns).
 
As per the wiki, .add files go in /jffs/configs. That's all you need, remove any other files you've made. Then reboot the router or restart avahi (service restart_mdns).
I'm an idiot!

Not sure what I did wrong with postconf, which should have worked as well, but putting the avahi-daemon.conf.add in the right place worked. Thanks so much for the help and patience, @ColinTaylor
 
Hi All,

Its interesting.... I have an openvpn server with 3 asuswrt connected client in Tun mode site-to-site. I can ping vica versa, works fine.

I tried to setup avahi which seemed to be installed but it was not working.

RT-AC86U with Merlin 386.12_4 amtm entware installed

I installed avahi with opkg following this tutorial: https://www.snbforums.com/threads/avahi-install.10218/

Then I filtered out user=admin in /opt/etc/avahi/avahi-daemon.conf and the daemon started...but:

Dec 25 13:40:46 avahi-daemon[9445]: *** WARNING: Detected another IPv4 mDNS stack running on this host. This makes mDNS unreliable and *
Dec 25 13:40:46 avahi-daemon[9445]: Host name conflict, retrying with RT-AC86U-virag-2
Dec 25 13:40:47 avahi-daemon[9445]: Host name conflict, retrying with RT-AC86U-virag-3
Dec 25 13:40:48 avahi-daemon[9445]: Host name conflict, retrying with RT-AC86U-virag-4

So the merlin had already had an avahi installed, then I installed it again from opkg :/

How can or how should I decide which one to keep and which one to run?

ps w :
9445 nobody 4744 S avahi-daemon: registering [RT-AC86U-virag-26.virag.local]
9904 admin 5976 S grep avahi
17559 nobody 3176 S avahi-daemon: running [RT-AC86U-virag.local]

service stop_mdns made the trick, but how can this happen? Why are there two installs?

Thanks for your help!

EDIT:

I got rid of opkg installed avahi. I removed all with their dependencies, now it is running with only one instance. Then I tried to locate the config file it is using, I removed all the .add files and all of them, the only one left is /tmp/avahi/avahi-daemon.conf

If I write different alias like alias=RT-AC86U2 instead of alias=RT-AC86U in the log file it is unchanged if I make it stop with service stop_mdns and start with service start_mdns, the output in /tmp/syslog.log is always:
Dec 25 23:39:36 avahi-daemon[28132]: WARNING: No NSS support for mDNS detected, consider installing nss-mdns!
Dec 25 23:39:37 avahi-daemon[28132]: Alias name "RT-AC86U" successfully established.

Why? Why are there no changes what so ever if I modify the config file? There is something I am missing truly
 
Last edited:

Similar threads

Latest threads

Sign Up For SNBForums Daily Digest

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