The Bonjour service that Apple AirPlay uses to discover devices is limited to only work on a single network (subnet). However, in a home network with multiple subnets and or routers AirPlay wont work out of the box.
Here is an example of such a network:
- router 1 (192.168.1.0) – connected to the internet
- router 2 (192.168.2.0) – tunnels all traffic to the internet through a VPN (or other company related traffic)
- router 2 is connected to router 1 through its wan port and runs as a router (no NAT)
The challenge is to get two apple devices to talk together when one is connected to router 1 and the other connected to router 2. To enable this one has to take a look at the mechanism that Bonjour uses for discovery namely multicast DNS (mDNS).
In my case the routers I used were installed with DD-WRT which is a custom firmware but it didn’t come with anything that could allow me to parse do multicast between my LAN (br0) and WAN (vlan1/[vlan2]).
But I can across this post by Darell that gave a good description of whats needed. Essentially he describes how to compile ‘mdns-repeater’ which is a small tool that can do mDNS between two interfaces in the DD-WRT router.
He also lists Tildesoft.com Bonjour Browser, a useful tool for inspecting Bonjour messages.
Putting the mDNS repreater to work on a DD-WRT device with no space avaliable for storing the program can be achieved through the startup or firewall scrips like:
wget -O /tmp/mdns-repeater http://192.168.0.1/mdns-repeater && chmod +x /tmp/mdns-repeater && /tmp/mdns-repeater br0 vlan1