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.
- Is my problem related to multicasting across subnets?
- Is
mrouted
the preferred solution in FreeBSD to enable routing? - How do I create a
/etc/mrouted.conf
that routes between 10.0.1.0/24 and 10.0.2.0/24?
Thanks to @chris-s, I solved my own question by using Avahi instead of trying to route the multicast traffic.
This worked for me:
net/avahi
anddns/nss_mdns
from the ports tree.avahi_daemon_enable="YES"
anddbus_enable="YES"
to/etc/rc.conf
/usr/local/etc/avahi/avahi-daemon.conf
) and added my two internal network interfaces (two internal subnets) to theallow-interfaces
key (comma separated) and set theenable-reflector
key toyes
to make avahi propagate the traffic to all internal networks.hosts
entry in/etc/nsswitch.conf
tohosts: 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:
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 fromavahi-daemon
by default so I didn't see any logging at first (added adaemon.*
selector pointing to/var/log/daemon.log
)ad 3:
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.