upnp multicast forwarding on linux
I have a linux box - Fedora Core 2 with kernel 2.6.5 - acting as a bluetooth access point. The interface it uses for bluetooth is pan0 with ip address 192.168.70.1. The access point is connected to a wired LAN over interface eth0 which has IP address 192.168.1.x, which it gets from a DHCP server running on the LAN. I am running UPnP devices on several other hosts on the LAN, each with IP address 192.168.1.x.
I have several cell phones connected to the access point over bluetooth. Each phone has a static ip address 192.168.70.x. I have enabled ip forwarding on the access point and the phones are able to ping any host on the wired LAN. The phones all run control point applications that allow them to control the UPnP devices on the LAN.
The problem is that during the discovery phase, the control point issues a multicast MSEARCH message. UPnP issues multicasts on 18.104.22.168 with netmask 255.0.0.0 These packets are not getting forwarded by the access point. I have tethereal listening on eth0 and the packets never get sent out. So the phones are unable to discover devices on the wired LAN. I also want the phones to receive incoming multicasts from the devices on the LAN. The UPnP devices use mulitcast to send event updates to control points that are subscribed to the events. I need the phones to receive these events.
So I need the multicast to go from pan0 to eth0 and the reverse, which is where I am having trouble. Putting in two new entries into the routing table like this won't work:
route add -net 22.214.171.124 netmask 255.0.0.0 eth0
route add -net 126.96.36.199 netmask 255.0.0.0 pan0
This doesn't work because route will just follow the first match that it sees and so all the multicast packets will just be echoed onto eth0.
I thought about using a bridge, but I haven't tried it out yet. The problem is that I am already implicitly using a bridge with the Bluez bluetooth stack since each new phone connection creates a bnepX interface which is automatically added to the pan0 bridge. I also already have everything set up using ip forwarding so I am wondering if anyone has a solution to this using iptables or route. Thanks.