Avahi not restarting at boot - Resolved (as of latest 23.09 dev build)
-
@dennypage said in Avahi not restarting at boot:
@RobbieTT said in Avahi not restarting at boot:
Can you provide some detail about what internal device-to-device functions are not working?Sure, elements like device hand-off or the intercom either degrade or stop and accessing an iTunes server will just fail; specifically:
_daap._tcp. (Digital Audio Access Protocol (iTunes)) (port 3689)
_dacp._tcp. (Digital Audio Control Protocol (iTunes)) (port 49162)
_home-sharing._tcp. (iTunes Home Sharing) (port 3689)I also had to change my RA mode to finally unlock it all agin post iOS15 et al - a suggestion by @stephenw10 to help with a different IPv6 issue but it added the final ingredient to get it all running perfectly.
There is probably more that I could add but it is getting late here. I'll add more detail where needed; I may even have the original pcaps.
️
-
@RobbieTT said in Avahi not restarting at boot:
Sure, elements like device hand-off or the intercom either degrade or stop and accessing an iTunes server will just fail
Hmm... I'm thinking that there is another issue as Handoff works in my environment with IPv6 disabled in Avahi.
All Apple OSs function in environments where only IPv4 is available, so I don't see a circumstance in which they will not work without IPv6 mDNS. My initial guess would that you may have had a mDNS caching entity in your network that interfered.
FWIW, I looked in the other thread... seems like you had a lot of IPv6 problems. FWIW, I don't think @stephenw10 actually said that you should use RA Assisted, I believe he said that you should use RA Assisted unless you had a reason not to. And he followed up by saying that it isn't something he had spent much time looking at.
I run my networks RA Managed. I reserve/assign addresses for all hosts, and I have had no issues with any of the Apple clients.
-
It's probably a bit harsh on Netgate to say I have had a lot of problems with IPv6 on Netgate hardware. Yes, I have stumbled into some bugs. especially with the aggravating and interconnecting PPPoE issues; but they have worked with me, are keeping a good issues log and have issued bug fixes for me.
It is unfortunate that 1 bug fix just unmasked another bug hidden underneath but that is how it goes sometimes. It is awkward or inconvenient at times and I have had to make plans to take pfSense out of production should I be away for a protracted period but I am far from throwing my 6100 out and giving up.
Crashes and reboots are clearly undesirable but Netgate are clearly engaged with their efforts to fix the mixed PPPoE / IPv6 / Interface problems. For my part I would have probably never noticed the IPv6 issue with pfSense Avahi if it wasn't for the frequent reboots and crashes caused by different problems. I am also cognisant that the mixed issues I have would simply not apply (for example) to a US user of Netgate devices.
So in sum, the experience is not great but it is getting better and the issues I have only apply to a subset of Netgate / pfSense users.
️
-
@RobbieTT To be honest my experience with AVAHI wasn't very good.
I kept seeing multiple devices on my lan that were actually the same device with an _2, _3, etc .... in finder.
I gave up and added a multicast rule on each interface that was needed:-
I also added the devices into the shared services for good measure on my APs:-
It just works.
-
I guess our individual setups make a difference with mDNS, especially with multiple APs and switches to traverse as well as direct point-to-point. My home has 6 APs broadcasting 2 subnets for mDNS to work with. It also has multiple hubs and gateway devices for Thread / HomeKit et al.
Aside from the Avahi IPv6 flag preventing robust restarts it does its job and everything can talk to each other internally and reach externally as required. I also have quite a few mDNS devices - this (redacted) snapshot is during a relatively quiet period:
Plenty going on.
️
-
I kept seeing multiple devices on my lan that were actually the same device with an _2, _3, etc .... in finder.
Yep. What this means is that there are name collisions. How does this happen?
When a system initially connects to a network (such as boot) and sends out a name resolution query for the name it is configured for. So if you name the system "myhost", when it comes on the network it will send a mDNS resolution request for "myhost". If it receives a response saying that "myhost" can be reached at address X (it doesn't matter if it's the same address the host is on, or even if it's a different address family such as IPv4 vs IPv6), the host will append a sequential counter to the name and try again. "myhost-1", "myhost-2", and so on. It will continue until the resolution fails, and then it will settle on that name. This process ensures that no two hosts will have the same local name. [NB: this is the local mDNS name which is unrelated to a DHCP assigned name]
Assuming that you did not intentionally assign the same name to multiple hosts, for this collision to happen means that you have some form of mDNS caching in your network. Having a caching mDNS server was once thought to be a really great idea. It's not.
Avahi is able to operate as a mDNS cache. There was a very old version of the pfSense Avahi package that had this as an option, and it wreaked a lot of havoc. When I wrote the new (current) Avahi package, I hardcoded the configuration to disable caching.
It can be hard to locate the caching entity. There are several places to look:
- The most common is a Linux system running Avahi with a legacy configuration. Check the avahi-daemon.conf file. If the configuration does not have a line that says "cache-entries-max=0", add it and restart the service.
- Many WiFi APs have the ability to run a caching service. There are some vlan configurations where this is appropriate, but none in which Avahi is already present in both networks.
- Embedded systems. These are generally systems that use old Linux versions as the base OS, and have Avahi installed with caching enabled. If this is the case, you have to reach out to the manufacturer to get them to fix it. FWIW, I've encountered this with a couple of AirPlay audio systems, and in both cases the manufacturer was responsive and happy to address the issue once it was explained to them.
If you are not able to identify the network cache, then you have to resort to sniffing on the host or use a SPAN port on your switch.
@NogBadTheBad, In your case, the issue I see is that you have caching enabled in your APs, and also have Avahi spanning networks with reflection. You should have one or the other, but not both.
-
@dennypage I don’t actually have AVAHI running at all now and I’m also using a different brand AP.
I don’t have any issues now.
It been set up as per my previous post for a few years.
-
@dennypage I don't want to hijack the thread but am wondering if you can recommend a novice guide or resources for setting up HomeKit / Thread / etc., ideally with a Netgate router? I have a simple network with a 2100 running Avahi for the AppleTV, iOS devices and printer, but have been considering looking at migrating away from X-10 home automation and wondering what that might entail.
-
@terryzb said in Avahi not restarting at boot:
setting up HomeKit / Thread / etc.
Quite different technologies there, and as a general rule, unrelated to something like pfSense.
One thing I will say is that if you are looking to migrate from X-10, you have a big decision ahead of you, which is what core technology do you want to invest in? Z-Wave, Zigbee, Thread or Wifi. All have some advantages and disadvantages. I recommend that you seek guidance in a home automation forum regarding the relative benefits of each.
-
@dennypage said in Avahi not restarting at boot:
I expect that you are using DHCP to acquire an IPv6 delegation from the WAN, and then using it to configure internal interfaces via Track Interface.
Unless you are using fully static IPv6, I would recommend that you do not use IPv6 in Avahi. You don't loose anything by having IPv6 disabled in Avahi, and many devices that depend upon mDNS won't use IPv6 even if it is offered. IPv4 works just fine.
On pfSense 23.09d-20230921-1219 Avahi does now restart at boot with IPv6 selected.
Hurrah!
️