Avahi Reflector filtering patch

This is about transmitting Bonjour traffic across VLANs using Avahi Daemon as a reflector with a service filter patch applied.

We have multiple VLANs configured for Wi-Fi, and wired LANs and have AirServer terminals connected to classrooms needing to be discoverable from iPads and Macbooks on the Wi-Fi network.

Originally we were just using the standard Avahi-Daemon package provided by Ubuntu, but found as more BYOD laptops and iPads connected the reflected packets became greater and some services we did not want advertised (e.g. home shared printer, music libraries, etc). For this standard config there are multiple guides already available.

To filter out services we do not want I have written a patch to the Avahi code that allows you to enter a list of services you want to be reflected and only those will appear in other VLANs.

I based my implementation on the suggestion in Extending multicast DNS across local links in Campus and Enterprise Networks and it works by filtering out received packets before they are added to the daemon’s cache. All locally published services are allowed through.

Avahi-Reflector-Filter patches. This includes the main Reflector Filter patch and a patch to add _airplay._tcp to the listed services avahi-browse shows.

Avahi-Reflector-Filter.zip

For those looking to compile in Ubuntu make sure you also apply all the Ubuntu specific patches

I also needed to modify makefile input for make install to work correctly

--- a/avahi-python/avahi/Makefile.in
+++ b/avahi-python/avahi/Makefile.in
@@ -456,7 +456,7 @@
 $(INSTALL_DATA) $$files "$(DESTDIR)$(avahidir)" || exit $$?; \
 done || exit $$?; \
 if test -n "$$dlist"; then \
- $(am__py_compile) --destdir "$(DESTDIR)" \
+ $(am__py_compile) --destdir $(DESTDIR) \
 --basedir "$(avahidir)" $$dlist; \
 else :; fi

--- a/avahi-python/avahi-discover/Makefile.in
+++ b/avahi-python/avahi-discover/Makefile.in
@@ -477,7 +477,7 @@
 $(INSTALL_DATA) $$files "$(DESTDIR)$(avahi_discoverdir)" || exit $$?; \
 done || exit $$?; \
 if test -n "$$dlist"; then \
- $(am__py_compile) --destdir "$(DESTDIR)" \
+ $(am__py_compile) --destdir $(DESTDIR) \
 --basedir "$(avahi_discoverdir)" $$dlist; \
 else :; fi
 

To compile Avahi on Ubuntu 14.04 I used the following

./configure \
--disable-autoipd \
--enable-compat-libdns_sd \
--disable-mono \
--disable-monodoc \
--disable-qt3 \
--enable-gtk3 \
--with-systemdsystemunitdir=/lib/systemd/system \
--sysconfdir=/etc \
--localstatedir=/var

About James Rudd

Network Administrator at Sydney Boys High School
This entry was posted in General. Bookmark the permalink.

Leave a Reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.