Netgate Discussion Forum
    • Categories
    • Recent
    • Tags
    • Popular
    • Users
    • Search
    • Register
    • Login

    Avahi (mDNS) stops working after ~30 mins on pfSense 2.5

    pfSense Packages
    7
    21
    3.0k
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • S
      shad0wca7
      last edited by

      I've upgraded to pfSense 2.5 and my mDNS reflector (Avahi) was previously working well across my IoT and LAN subnet. Now the HomeKit devices disappear after about 30 minutes. Toggling Avahi on/off restores correct functionality. Avahi is still running - shows up in processes so it hasn't crashed.

      I have removed the package and reinstalled it - the same thing happens. Is this happening to anyone else and might there be something that can be done to fix it?

      Screenshot 2021-02-18 at 19.07.50.png
      Screenshot 2021-02-18 at 19.08.02.png

      S 1 Reply Last reply Reply Quote 0
      • S
        shad0wca7 @shad0wca7
        last edited by

        Right I think I've figured it out. It's now been just under 24 hours rock solid.
        I have pfBlockerNG and HAProxy installed. Both with virtual IPs that were created on the LAN interface.
        Looking in the logs, for some reason Avahi would give a log message like this:

        Leaving mDNS multicast group on interface em3.IPv4 with address 10.10.10.10
        Joining mDNS multicast group on interface em3.IPv4 with address 10.10.10.1
        

        Both of which were the virtual IPs. This would only happen after about 30-45 minutes of solid operation and then Avahi would stop working for some reason.
        After some experimenting, I changed the Virtual IPs to be bound to the 'localhost' interface and it's been solid since - it's stopped trying to work on those virtual IPs.

        mrvargaM 1 Reply Last reply Reply Quote 0
        • mrvargaM
          mrvarga @shad0wca7
          last edited by

          @shad0wca7 I updated the pfsense to 2.5 and from tjat moment I'am not able to streaming things on my tv from youtube app on my phone. Same things music in google home. Avahi is enabled, can you help me solve this problem?!?!

          S 1 Reply Last reply Reply Quote 0
          • S
            shad0wca7 @mrvarga
            last edited by

            @mrvarga What does it say in Status -> System Logs if you filter for process 'avahi'?

            mrvargaM 1 Reply Last reply Reply Quote 0
            • mrvargaM
              mrvarga @shad0wca7
              last edited by

              @shad0wca7 I Found this in log...

              Feb 25 19:05:03	avahi-daemon	32451	Leaving mDNS multicast group on interface igb1.IPv4 with address 192.168.2.1.
              Feb 25 19:05:03	avahi-daemon	32451	avahi-daemon 0.8 exiting.
              Feb 25 19:05:03	avahi-daemon	61026	Found user 'avahi' (UID 558) and group 'avahi' (GID 558).
              Feb 25 19:05:03	avahi-daemon	61026	Successfully dropped root privileges.
              Feb 25 19:05:03	avahi-daemon	61026	avahi-daemon 0.8 starting up.
              Feb 25 19:05:03	avahi-daemon	61026	WARNING: No NSS support for mDNS detected, consider installing nss-mdns!
              Feb 25 19:05:03	avahi-daemon	61026	Loading service file /usr/local/etc/avahi/services/sftp-ssh.service.
              Feb 25 19:05:03	avahi-daemon	61026	Loading service file /usr/local/etc/avahi/services/ssh.service.
              Feb 25 19:05:03	avahi-daemon	61026	Joining mDNS multicast group on interface igb1.IPv4 with address 10.10.10.1.
              Feb 25 19:05:03	avahi-daemon	61026	New relevant interface igb1.IPv4 for mDNS.
              Feb 25 19:05:03	avahi-daemon	61026	Network interface enumeration completed.
              Feb 25 19:05:03	avahi-daemon	61026	Server startup complete. Host name is pfSense.local. Local service cookie is 1988293464.
              Feb 25 19:05:03	avahi-daemon	61026	Failed to add service 'pfSense' of type '_ssh._tcp', ignoring service group (/usr/local/etc/avahi/services/ssh.service): Not permitted
              Feb 25 19:05:03	avahi-daemon	61026	Failed to add service 'pfSense' of type '_sftp-ssh._tcp', ignoring service group (/usr/local/etc/avahi/services/sftp-ssh.service): Not permitted
              
              GertjanG 1 Reply Last reply Reply Quote 0
              • GertjanG
                Gertjan @mrvarga
                last edited by

                @mrvarga

                Humm. For a moment, I thought you were on to something.

                I have some air print (bonjour) printers on my LAN - 192.168.1.0/24
                I have also a captive portal for clients 192.168.2.0/24.
                Avahi exposes these printers to the captive portal clients.

                I connected my phone to the captive portal => no printers were listed. That was not normal.

                Asked the logs what might happened.
                And found it.
                Yesterday :

                31c604cc-30fd-431f-aaac-027b497e4436-image.png

                that was me ripping out de cable 192.168.2.0/24 (em2) captive portal - for some testing.

                Avahi detaches itself, but doesn't attach itself when the cable was back in place. I had to restart Avahi to 'bind' it again to 192.168.2.0/24.

                Did something comparable happened to you ?

                No "help me" PM's please. Use the forum, the community will thank you.
                Edit : and where are the logs ??

                mrvargaM 1 Reply Last reply Reply Quote 0
                • mrvargaM
                  mrvarga @Gertjan
                  last edited by

                  @gertjan said in Avahi (mDNS) stops working after ~30 mins on pfSense 2.5:

                  I using all clients in wifi connection, but before updating to 2.5 all works great for me.

                  GertjanG 1 Reply Last reply Reply Quote 0
                  • GertjanG
                    Gertjan @mrvarga
                    last edited by

                    My captive portal is also 'wifi' based.

                    Its 29 minutes later now, I can still see all my printers.

                    No "help me" PM's please. Use the forum, the community will thank you.
                    Edit : and where are the logs ??

                    S 1 Reply Last reply Reply Quote 0
                    • S
                      shad0wca7 @Gertjan
                      last edited by

                      @gertjan do you have any virtual IPs or other interfaces?

                      GertjanG 1 Reply Last reply Reply Quote 0
                      • GertjanG
                        Gertjan @shad0wca7
                        last edited by

                        @shad0wca7

                        Like this one :

                        41a66d97-84a3-4220-bb5c-7e734728edf5-image.png 481373c6-f0bf-4d37-bc14-46af2c242f62-image.png

                        I think so yes.
                        I parked it on the lo0 (local host) interface.

                        No "help me" PM's please. Use the forum, the community will thank you.
                        Edit : and where are the logs ??

                        S 1 Reply Last reply Reply Quote 0
                        • S
                          shad0wca7 @Gertjan
                          last edited by

                          @gertjan is your avahi on just the ipv4 interfaces?

                          GertjanG 1 Reply Last reply Reply Quote 0
                          • GertjanG
                            Gertjan @shad0wca7
                            last edited by Gertjan

                            IPv4 is present for backwards computability.

                            Most LAN traffic is IPv6.

                            2d627218-bf2b-43bb-b738-39bd47152920-image.png

                            Portal traffic is IPv4 only.

                            No "help me" PM's please. Use the forum, the community will thank you.
                            Edit : and where are the logs ??

                            S 1 Reply Last reply Reply Quote 0
                            • S
                              shad0wca7 @Gertjan
                              last edited by

                              @gertjan I see. Since you’ve already checked virtual IPs that was what was causing my issue so I’m not sure what else I can suggest unless something else is causing another in / interface to appear on ipv6 which is causing avahi troubles..

                              1 Reply Last reply Reply Quote 0
                              • mrvargaM
                                mrvarga
                                last edited by

                                This is the log, I still don't see device for casting.in youtube also in spotify, no tv no google mini.

                                Mar 1 17:17:00	avahi-daemon	39099	Found user 'avahi' (UID 558) and group 'avahi' (GID 558).
                                Mar 1 17:17:00	avahi-daemon	39099	Successfully dropped root privileges.
                                Mar 1 17:17:00	avahi-daemon	39099	avahi-daemon 0.8 starting up.
                                Mar 1 17:17:00	avahi-daemon	38815	Found user 'avahi' (UID 558) and group 'avahi' (GID 558).
                                Mar 1 17:17:00	avahi-daemon	38815	Successfully dropped root privileges.
                                Mar 1 17:17:00	avahi-daemon	38815	open(/var/run/avahi-daemon//pid): File exists
                                Mar 1 17:17:00	avahi-daemon	38815	Failed to create PID file: File exists
                                Mar 1 17:17:00	avahi-daemon	39099	WARNING: No NSS support for mDNS detected, consider installing nss-mdns!
                                Mar 1 17:17:00	avahi-daemon	39099	Loading service file /usr/local/etc/avahi/services/sftp-ssh.service.
                                Mar 1 17:17:00	avahi-daemon	39099	Loading service file /usr/local/etc/avahi/services/ssh.service.
                                Mar 1 17:17:00	avahi-daemon	39099	Joining mDNS multicast group on interface igb1.IPv4 with address 10.10.10.1.
                                Mar 1 17:17:00	avahi-daemon	39099	New relevant interface igb1.IPv4 for mDNS.
                                Mar 1 17:17:00	avahi-daemon	39099	Network interface enumeration completed.
                                Mar 1 17:17:00	avahi-daemon	39099	Server startup complete. Host name is pfSense.local. Local service cookie is 717637330.
                                Mar 1 17:17:00	avahi-daemon	39099	Failed to add service 'pfSense' of type '_ssh._tcp', ignoring service group (/usr/local/etc/avahi/services/ssh.service): Not permitted
                                Mar 1 17:17:00	avahi-daemon	39099	Failed to add service 'pfSense' of type '_sftp-ssh._tcp', ignoring service group (/usr/local/etc/avahi/services/sftp-ssh.service): Not permitted
                                Mar 1 17:30:24	avahi-daemon	39099	Leaving mDNS multicast group on interface igb1.IPv4 with address 10.10.10.1.
                                Mar 1 17:30:24	avahi-daemon	39099	Joining mDNS multicast group on interface igb1.IPv4 with address 192.168.2.1
                                
                                GertjanG 1 Reply Last reply Reply Quote 0
                                • GertjanG
                                  Gertjan @mrvarga
                                  last edited by

                                  Up until :

                                  @mrvarga said in Avahi (mDNS) stops working after ~30 mins on pfSense 2.5:

                                  Mar 1 17:17:00 avahi-daemon 39099 Failed to add service 'pfSense' of type '_sftp-ssh._tcp', ignoring service group (/usr/local/etc/avahi/services/sftp-ssh.service): Not permitted

                                  I see the same lines.

                                  But my Avahi isn't

                                  Joining mDNS multicast group on interface igb1.IPv4 with address 10.10.10.1.

                                  as this is the pfBlockerNG web interface. Not some sort of network where I need Avahi to do something.

                                  Btw : I parked this 10.10.10.1 to the local lo0 network :

                                  @gertjan said in Avahi (mDNS) stops working after ~30 mins on pfSense 2.5:

                                  I parked it on the lo0 (local host) interface.

                                  ( not on LAN !! )

                                  Also : Avahi doesn't log what it does.

                                  No "help me" PM's please. Use the forum, the community will thank you.
                                  Edit : and where are the logs ??

                                  T 1 Reply Last reply Reply Quote 0
                                  • T
                                    TheSkelly @Gertjan
                                    last edited by

                                    Hello to anyone who stumbles across this.
                                    I too was battling with this Avahi issue and discovered that the root cause (in my case at least) was that Avahi wasn't re-joining interfaces properly after suricata does it's updates/refreshes. Disabling suricata means that Avahi now works flawlessly.

                                    Whilst not ideal for those who wish to use Suricata, I hope this will help to narrow down the cause of the problem for anyone who gets stuck on it like I did!

                                    bmeeksB 1 Reply Last reply Reply Quote 0
                                    • bmeeksB
                                      bmeeks @TheSkelly
                                      last edited by bmeeks

                                      @theskelly said in Avahi (mDNS) stops working after ~30 mins on pfSense 2.5:

                                      Hello to anyone who stumbles across this.
                                      I too was battling with this Avahi issue and discovered that the root cause (in my case at least) was that Avahi wasn't re-joining interfaces properly after suricata does it's updates/refreshes. Disabling suricata means that Avahi now works flawlessly.

                                      Whilst not ideal for those who wish to use Suricata, I hope this will help to narrow down the cause of the problem for anyone who gets stuck on it like I did!

                                      This likely happens because Suricata (if running with Inline IPS Mode) will cause netmap to take the interface down and then back up as Suricata stops and restarts. This is an artifact of the netmap kernel device and not something Suricata does intentionally.

                                      I would not expect that behavior with Legacy Mode, though, as that simply uses libpcap to grab copies of packets traversing the interface. To my knowledge libpcap won't cycle the interface when it is stopped and restarted.

                                      1 Reply Last reply Reply Quote 0
                                      • V
                                        vlan_one
                                        last edited by

                                        I have the same issue with Suricata resetting the interfaces. I looked into the suggestion made by @bmeeks, but do not know where to set the mode between inline and legacy. I had a quick look around, but I am yet to find the option. I have also read that it is the safer option to stay in Inline mode if you can.

                                        With this in mind, I have enabled the setting where Suricata would do a live rules swap after a rules update. It states that it would not do a hard reset of the Suricata instances.

                                        Goto Services/Suricata/Global Settings then under Rules Update Settings enable Live Rule Swap on Update.

                                        I have done a manual rules update to test and when Suricata did the live swap it did not reset the interfaces so this seems to be working for now.

                                        T 1 Reply Last reply Reply Quote 1
                                        • J
                                          Jim Coogan
                                          last edited by

                                          I had similar issue with Avahi and the posts about Suricata got me thinking and I realized I had a cron job to restart an openvpn client and server and it was the cause of my Avahi and homekit issues even though avahi was not bound to the openvpn interfaces.

                                          1 Reply Last reply Reply Quote 0
                                          • T
                                            TheSkelly @vlan_one
                                            last edited by

                                            @vlan_one thanks for the suggestion! The Live Rule Swap option fixed this for me. Now I can run both Avahi and Suricata with no issues 😁

                                            V 1 Reply Last reply Reply Quote 0
                                            • First post
                                              Last post
                                            Copyright 2025 Rubicon Communications LLC (Netgate). All rights reserved.