I have a FreeBSD 9 router (a Soekris net6501) connected to the internet via a dsl modem (bridged), doing NAT for two internal subnets, (LAN) and (wifi net).

There are routes between the subnets and things like ssh host-A.wifi from host-B.lan works.

But, wireless clients (like iPads and iPhones) on the net can't seem to find stuff on the LAN (for example, airplay to an Apple-TV on the LAN).

I'm not totally sure, but I think this is because Apple uses Bonjour and Bonjour uses Multicast to find things and Multicast is not routed across subnets.

According to the FreeBSD handbook, to route multicast, I need to compile the kernel with options MROUTING and create a /etc/mrouted.conf, but I can't find any good examples of the configuration file.

  1. Is my problem related to multicasting across subnets?
  2. Is mrouted the preferred solution in FreeBSD to enable routing?
  3. How do I create a /etc/mrouted.conf that routes between and
  • Boujour makes my head hurt, but IIRC you want the Avahi package and daemon running on the router.
    – Chris S
    Feb 6 '12 at 13:59

Thanks to @chris-s, I solved my own question by using Avahi instead of trying to route the multicast traffic.

This worked for me:

  • Compile and install net/avahi and dns/nss_mdns from the ports tree.
  • Add avahi_daemon_enable="YES"and dbus_enable="YES" to /etc/rc.conf
  • Use the avahi configuration file (/usr/local/etc/avahi/avahi-daemon.conf) and added my two internal network interfaces (two internal subnets) to the allow-interfaces key (comma separated) and set the enable-reflector key to yes to make avahi propagate the traffic to all internal networks.
  • Edit the hosts entry in /etc/nsswitch.conf to hosts: files dns mdns

After starting the avahi daemon, you can check if it works either by directly doing a lookup from the mdns server machine:

root@server / # getent hosts apple-tv.local          apple-tv.local
root@server / # getent hosts iphone4s.local         iphone4s.local
root@server / # getent hosts ipad.local         ipad.local

Or by browsing the .local domain with a utility like Bonjour Browser or iStumbler (both excellent). You should be able to see devices, hosts and services on all subnets.

A footnote is that my stock FreeBSD 9.0 installation's /etc/syslogd.conf didn't log the messages from avahi-daemon by default so I didn't see any logging at first (added a daemon.* selector pointing to /var/log/daemon.log)


ad 3:

phyint em0 rate_limit 0 igmpv1
phyint em1 rate_limit 0 igmpv1

But beware, most likely the AppleTV sends packets with a TTL of 1, so they can not routed.

A quick google search show, that other possibilities are a Bonjour "Proxy" or by adding the services to the DNS.

  • Thanks, but avahi seemed easier to try than my original multicast routing idea. Feb 7 '12 at 14:03

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.