8

I have a FreeBSD 9 router (a Soekris net6501) connected to the internet via a dsl modem (bridged), doing NAT for two internal subnets, 10.0.1.0/24 (LAN) and 10.0.2.0/24 (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 10.0.2.0/24 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 10.0.1.0/24 and 10.0.2.0/24?
Erik Tjernlund
  • 251
  • 3
  • 8
  • Boujour makes my head hurt, but IIRC you want the Avahi package and daemon running on the router. – Chris S Feb 06 '12 at 13:59

2 Answers2

7

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
10.0.1.4          apple-tv.local
root@server / # getent hosts iphone4s.local
10.0.2.27         iphone4s.local
root@server / # getent hosts ipad.local
10.0.2.22         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)

Erik Tjernlund
  • 251
  • 3
  • 8
0

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.

arved
  • 453
  • 2
  • 14