Avahi blocks mDNS port

Hi,

I am using mdns-reflector in a docker container to bridge mDNS into a docker bridged network that is used by the home assistant container.

It all works well if I don’t enable avahi on the truenas host. It seems that the config setting “disallow-other-stacks” prevents mdns-reflector to bind on the necessary UDP ports.

Would it be possible to change this default config or to introduce a UI option to configure it?

I have a related issue. When running homebridge in docker on TrueNAS, it fails to start because of “disallow-other-stacks=no”. If I change that to =yes, everything works as expected. However the avahi config does not survive a reboot. Is there an easy solution for that?

Would it help to add -mdns as a command to you docker file configuration?

Sorry, I don’t understand what you mean. Can you clarify?

Sorry, I wasn’t clear: in the edit sheet of your app, there’s the section “Container Configuration” and then “Command”. If you add

-mdns

as a command, does that help? It helped me (with a different app though)…

In other words, I think it helped to prevent Avahi blocking port 5353 for apps, which (I think) you can check if you go to TrueNAS’ shell with:

sudo lsof -i:5353

But I might be wrong!

Huh, I still don’t get it? I deploy my container using a doocker-compose file with Dockge. Adding something in the command section would add it to the command that is run inside the docker container.

My container runs with host networking and it has to.

I’m not familiar with Dockge, and I use this with another app (LMS). I just tried it without the command and it seems to work too… It doesn’t survive reboots of the server though, I have to disable/re-enable mDNS in Network - Global Configuration…

Right, I know, that is exactly what I want to avoid - avoiding this is what the thread is about.

@hansinator - I followed these instructions and just retrofitted for the fing agent (network discovery tool) and it is working for me.

Just make sure to grab a free IP on your network and then reserve it on your router so DHCP doesn’t pick it up and cause a conflict. And you don’t need host network even if Dockge calls for it, because you are specifying your custom network. Since you are using a different IP than your TrueNAS, there will no longer be a conflict.

Here is what my config ended up looking like:

networks:
  fing_net:
    driver: macvlan
    driver_opts:
      parent: eno1
    ipam:
      config:
        - gateway: 192.168.5.1
          subnet: 192.168.5.0/24
services:
  fing-agent:
    cap_add:
      - NET_ADMIN
    container_name: fing-agent
    image: fing/fing-agent:latest
    networks:
      fing_net:
        ipv4_address: 192.168.5.44
    ports:
      - 44444:44444/tcp
      - 1900:1900/udp
    restart: unless-stopped
    volumes:
      - /mnt/default/fing-agent:/app/fingdata