AVAHI or Bonjour Across VLAN's


Recommended Posts

Howdy Gents,

 

I am trying to setup an AVAHI Daemon for mDNS, Bonjour etc. across multiple network segments. I figured the easiest way to do this would be via a docker container but I haven't had any success finding an UNRAID template. Has anyone else done this via a docker container? Maybe I could just leverage the AVAHI Daemon that's in UNRAID? Open to suggestions but note that I have no additional hardware for AVAHI - this would need to run on the host or docker container. Thanks!

Link to comment
  • 9 months later...
On 7/7/2019 at 5:37 PM, kl0wn said:

Howdy Gents,

 

I am trying to setup an AVAHI Daemon for mDNS, Bonjour etc. across multiple network segments. I figured the easiest way to do this would be via a docker container but I haven't had any success finding an UNRAID template. Has anyone else done this via a docker container? Maybe I could just leverage the AVAHI Daemon that's in UNRAID? Open to suggestions but note that I have no additional hardware for AVAHI - this would need to run on the host or docker container. Thanks!

Did you ever figure this out? I have my IoT devices on one subnet while computers are on another. It's great for security, but I can't AirPlay because of it..

Link to comment
  • 2 weeks later...

Hey, is there any chance to make it work also with docker networks? 
I have a chromecast on my "localdomain" network and a homeassistant docker in a "reverseproxy" network. (created with "create docker network reverseproxy")
While i can ping chromecast.localdomain from homeassistant console, i doesn't appear in the devices even with manually setup.
How can i repeat the mdns from one domain to another?
I can't find how to setup avahi. Since pfsense doens't have access to "reverseproxy" domain

Link to comment
  • 3 weeks later...

Any luck with this? I'm in the exact same boat as you with home assistant, I read an old post about someone setting up avahi on a small ubuntu VM. May try that later. 

 

Edit: No luck enabling avahi in an ubuntu VM. Not sure if there's a solution. I ended up setting up the cast node in node-red to handle sending announcements to speakers around the house. 

Edited by wewantrice
Link to comment
  • 1 year later...

Since this was the first result in a Google search when I was looking for a solution, I will post my solution here. I created an MDNS reflector with a  Docker container to reflect between my secure LAN , IOT -VLAN2, and Guest -VLAN3 networks. Change the specifics to fit your situation. 
 

1- Create docker networks for the VLANs (one time setup in Unraid terminal):

   docker network create --driver macvlan --subnet 192.168.2.0/24 --gateway 192.168.2.1 --opt parent=eth0.2 vlan2

   docker network create --driver macvlan --subnet 192.168.3.0/24 --gateway 192.168.3.1 --opt parent=eth0.3 vlan3 

 

2- Create docker container:

    Name:Avahi  (name is used in Post Arguments later)

    Repository:flungo/avahi

    Network Type:Custom:br0

    Fixed IP address:192.168.1.20

 

   Docker Variables:

      REFLECTOR_ENABLE_REFLECTOR

         Key:REFLECTOR_ENABLE_REFLECTOR

         Value:yes

 

   Docker Post Arguments: (ADVANCED VIEW)

      ; docker network connect vlan2 Avahi --ip 192.168.2.20; docker network connect vlan3 Avahi --ip 192.168.3.20

Edited by kp74508
  • Like 3
Link to comment
12 hours ago, kp74508 said:

Since this was the first result in a Google search when I was looking for a solution, I will post my solution here. I created an MDNS reflector with a  Docker container to reflect between my secure LAN , IOT -VLAN2, and Guest -VLAN3 networks. Change the specifics to fit your situation. 
 

1- Create docker networks for the VLANs (one time setup in Unraid terminal):

   docker network create --driver macvlan --subnet 192.168.2.0/24 --gateway 192.168.2.1 --opt parent=eth0.2 br0.2

   docker network create --driver macvlan --subnet 192.168.3.0/24 --gateway 192.168.3.1 --opt parent=eth0.3 br0.3

 

2- Create docker container:

    Name:Avahi  (name is used in Post Arguments later)

    Repository:flungo/avahi

    Network Type:Custom:br0

    Fixed IP address:192.168.1.20

 

   Docker Variables:

      REFLECTOR_ENABLE_REFLECTOR

         Key:REFLECTOR_ENABLE_REFLECTOR

         Value:yes

 

   Docker Post Arguments: (ADVANCED VIEW)

      ; docker network connect br0.2 Avahi --ip 192.168.2.20; docker network connect br0.3 Avahi --ip 192.168.3.20

Thanks! I ended up snagging a Firewalla Gold a few months back and it has mDNS reflection built in.

Link to comment
  • 1 year later...

Thank you, @kp74508

 

Your instruction was really helpful. My Linux Mint VM that sits on a different vlan can finally have access to the main network's printer with full print&scan functions.

 

To anyone visiting this thread in the future:

I had already created a vlan for VM and only needed to enable this network within the docker setting menu. No need to manually create the network using terminal.

Edited by jfoxwu
Link to comment

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.