Previous Employee
Posts: 13,551
Registered: ‎06-10-2011
Kudos: 5479
Solutions: 1656
Contributions: 2

Re: mDNS/bonjour forwarding


snowball wrote:

Excellent!  You might even consider passing in as arguments or environment variables any salient details such as a the /root.dev/w.o/ path to the previous install etc. so that scripts won't get broken if you change something in the future.

 

Thanks!


Yeah that's possible, though the scripts probably should not rely on the path to the previous install etc. If there's some files that need to be accessed from different installed versions, it might be better to put them under /root.dev since that is persistent and not specific to a particular version.

Regular Member
Posts: 455
Registered: ‎03-15-2012
Kudos: 129
Solutions: 7

Re: mDNS/bonjour forwarding

[ Edited ]

UBNT-stig wrote:


If you look at the script, the 1st thing it does is check if it's already be done once.  If so it exits.

 

Right!  But I think the idea of the post-upgrade scripts is cleaner -- I guess my thought was to take the guesswork out of "did an upgrade just occur since the last boot?"

 

Thanks!

Regular Member
Posts: 455
Registered: ‎03-15-2012
Kudos: 129
Solutions: 7

Re: mDNS/bonjour forwarding

[ Edited ]

@UBNT-ancheng wrote:

Yeah that's possible, though the scripts probably should not rely on the path to the previous install etc. If there's some files that need to be accessed from different installed versions, it might be better to put them under /root.dev since that is persistent and not specific to a particular version.


That's why I suggested passing them in as command line args (or environment variables) to the scripts.  That way you can change it as you need (or omit it if necessary).  For example:

 

#!/bin/sh

OLDINSTALL="$1"

apt-get install avahi-daemon

if [ $? != 0 ]; then
# Check for failed install ...
echo "Install failed!"
exit 1
fi
if [ -f $OLDINSTALL/etc/avahi/avahi-daemon.conf ]; then # Copy files from previous installation cp $OLDINSTALL/etc/avahi/avahi-daemon.conf /etc/avahi/ fi
# ...

 

Previous Employee
Posts: 13,551
Registered: ‎06-10-2011
Kudos: 5479
Solutions: 1656
Contributions: 2

Re: mDNS/bonjour forwarding


snowball wrote:

That's why I suggested passing them in as command line args (or environment variables) to the scripts.  That way you can change it as you need (or omit it if necessary).  For example:

 

#!/bin/sh

OLDINSTALL="$1"

apt-get install avahi-daemon

if [ $? != 0 ]; then
# Check for failed install ...
echo "Install failed!"
exit 1
fi
if [ -d $OLDINSTALL ]; then # Copy files from previous installation fi # ...

 


Yeah sure, that's one way to do it. I was thinking if some files are needed across different versions, they can be placed under the "persistent" root (/root.dev) and then just symlinked from each version. That way the copy won't be needed and changing the single copy of a file will take effect in both installed versions.

 

Of course we can also support both so people can use the approach that they find more convenient. Icon Smile

Regular Member
Posts: 455
Registered: ‎03-15-2012
Kudos: 129
Solutions: 7

Re: mDNS/bonjour forwarding


@UBNT-ancheng wrote:

Yeah sure, that's one way to do it. I was thinking if some files are needed across different versions, they can be placed under the "persistent" root (/root.dev) and then just symlinked from each version. That way the copy won't be needed and changing the single copy of a file will take effect in both installed versions.

 

Of course we can also support both so people can use the approach that they find more convenient. Icon Smile


Ah, the "persistent root" is new to me!  Yes, symlinking is probably a better idea if there's persistent storage, could also be done to /config?

 

How do you switch between installed versions?  Or is this just for rolling back in case of a failed upgrade ...

Previous Employee
Posts: 13,551
Registered: ‎06-10-2011
Kudos: 5479
Solutions: 1656
Contributions: 2

Re: mDNS/bonjour forwarding

[ Edited ]

snowball wrote:

Ah, the "persistent root" is new to me!  Yes, symlinking is probably a better idea if there's persistent storage, could also be done to /config?

 

How do you switch between installed versions?  Or is this just for rolling back in case of a failed upgrade ...


Currently "/config" is only copied on upgrade. One reason is that after an upgrade, the config file syntax may change and the file will be automatically "migrated", which means it may no longer be completely compatible with the old version.

 

To switch between versions, the "set system image default-boot" command can be used from the CLI.

New Member
Posts: 1
Registered: ‎01-28-2013
Kudos: 8
Solutions: 1

Re: mDNS/bonjour forwarding


@UBNT-ancheng wrote:

If you install the Debian package, let us know if it works. If it solves the problem and doesn't cause other problems, maybe we can include it at some point. Thanks.



Just wanted to say that this has been running with no adverse effects for me. In avahi-daemon.conf, just set:

...
[reflector]
enable-reflector=yes

and optionally configure allowed interfaces and it's good to go.

Previous Employee
Posts: 13,551
Registered: ‎06-10-2011
Kudos: 5479
Solutions: 1656
Contributions: 2

Re: mDNS/bonjour forwarding

Thanks for providing the information! We will look into it.

New Member
Posts: 1
Registered: ‎05-06-2013
Kudos: 3

Re: mDNS/bonjour forwarding

Works well with Apple TV and other apple devices. Solution is well. In the GUI for the interface check "ARP proxy"
Previous Employee
Posts: 13,551
Registered: ‎06-10-2011
Kudos: 5479
Solutions: 1656
Contributions: 2

Re: mDNS/bonjour forwarding

Maybe we can implement a setting like "service mdns reflector enable", which when configured will start the avahi daemon with the reflector configuration? We could add more settings later like allowed interfaces etc. of course.

Regular Member
Posts: 455
Registered: ‎03-15-2012
Kudos: 129
Solutions: 7

Re: mDNS/bonjour forwarding


@UBNT-ancheng wrote:

Maybe we can implement a setting like "service mdns reflector enable", which when configured will start the avahi daemon with the reflector configuration? We could add more settings later like allowed interfaces etc. of course.


 

This would be great!  Saves having to set up the package repository and install the avahi-daemon each time there's an upgrade.

 

Thanks!

Previous Employee
Posts: 13,551
Registered: ‎06-10-2011
Kudos: 5479
Solutions: 1656
Contributions: 2

Re: mDNS/bonjour forwarding

The mDNS reflector setting has bee added in the latest alpha release, so if you are interested in give it a try, please participate in the beta program. Thanks.

New Member
Posts: 10
Registered: ‎10-08-2013
Kudos: 1

Re: mDNS/bonjour forwarding

[ Edited ]

@UBNT-ancheng I'm not so keen to live on the bleeding edge. Can you provide a timeframe when this new release with the mDNS reflector will be published? At the moment, this is the only feature that I miss to put my LAN and WLAN devices in separate subnets.

 

EDIT: I have overlooked it is already released. :-)

Member
Posts: 250
Registered: ‎02-03-2014
Kudos: 19
Solutions: 9

Re: mDNS/bonjour forwarding

Sorry if this question has already been answered (I'm quite new to EdgeRouter). I've run into a situation where I need to get airplay working across VLANs and it seems that this will work brilliantly.

You mentioned it was added to the alpha release.. Do you know which version? I'm currently running v1.40 and was wonderg if this feature was included in this release?

It would be great if it were GUI configurable!

Thanks!
-Ryan

Previous Employee
Posts: 10,504
Registered: ‎06-09-2011
Kudos: 3142
Solutions: 945
Contributions: 16

Re: mDNS/bonjour forwarding

configure
set service mdns reflector
commit
save
exit

 

EdgeMAX Router Software Development
Highlighted
Senior Member
Posts: 3,333
Registered: ‎05-19-2013
Kudos: 1451
Solutions: 33

Re: mDNS/bonjour forwarding

@CiscoKid85

This mDNS/Bonjour reflector feature is already included since v1.3.0.
Member
Posts: 250
Registered: ‎02-03-2014
Kudos: 19
Solutions: 9

Re: mDNS/bonjour forwarding

Is there an easy way to restrict this to certain interfaces?

Established Member
Posts: 1,837
Registered: ‎02-07-2014
Kudos: 624
Solutions: 36

Re: mDNS/bonjour forwarding

You'll have to edit /etc/avahi.avahi-daemon.conf for that I suppose...
Still testing myself...

New Member
Posts: 1
Registered: ‎05-14-2014

Re: mDNS/bonjour forwarding


@UBNT-stig wrote:
configure
set service mdns reflector
commit
save
exit

 


Thanks for this! Very easy and works!

Established Member
Posts: 1,837
Registered: ‎02-07-2014
Kudos: 624
Solutions: 36

Re: mDNS/bonjour forwarding

Hmmmm, getting often hostname is already in use prompt when mDNS is enabled and macs are waking from sleep... seems it needs some tweaking.. Didn't really find anything usefull on avahi.org (most of the time even getting internal server errors while trying to search that site).

Anybody else seeing these issues with avahi?