How do I join two subnets with two DD-WRT routers?

I have two separate DD-WRT routers which I would like to bridge together so that computers connected to each are on the same subnet (so that multicast can work between them for UPNP/DNLA media sharing)

Each DD-WRT router has its own internet connection with a gigabit connection between them on the WAN port and both have their own public IP.

INTERNET--------
               |
               |
        [Gigabit Switch]
           |         |
    [DD-WRT A]      [DD-WRT B]
       |                   |
    [LAN A]              [LAN B]
    [192.168.11.0/24]    [192.168.12.0/24]

I only have control over the DD-WRT boxes and the LANs they control. (not the switch)

I've followed this guide http://www.dd-wrt.com/wiki/index.php/Linking_Subnets_with_Static_Routes and treated Router1 as the switch and left both of the DD-WRT routers in gateway mode. This allowed both of the subnets to speak to each-other, but multicast would not work across them.

I'd like to find a way to make multicast to work across the two subnets or somehow split one subnet over both routers. Connecting the routers directly to each other is not an option as they are not located physically near each other.

I've also looked into the idea of using one router as a VPN server and another as a client. But this only put the client router on the server router's subnet and not all the computers attached to that router, unless I did something wrong. I'd also like each router to use its own internet connection and not send it all through a single connection, if possible.


Solution 1:

The easiest solution is to physically link the two DDWRT switches into one network.

Your diagram implies the two routers go into the same switching fabric? If the direct connection is in the realm of possibility do it, get a straight Ethernet link plumbed the same way between the two routers. Otherwise you may be able to get a VLAN setup on the external switches and two ports for your connection.

Another way is to create a wireless repeating bridge between your two routers if a WAN connection is possible and bandwidth requirements allow it.

These 3 bridge options will give you one big network, and you'll need to do extra work with your clients or DHCP server to meet your requirement of keeping internet traffic on the local router.

If you can't create the physical connection between the two networks you will need to use an IP tunnel to either bridge the networks or route the data. You could create the built in OpenVPN tunnel between the DDWRT boxes via the external interfaces:

INTERNET--------
               |
               |
          [Gigabit Switch]
           |           |
   [DD-WRT A]-- tun --[DD-WRT B]
       |                   |
    [LAN A]              [LAN B]
    [192.168.11.0/24]    [192.168.12.0/24]

DDWRT doesn't come with GUI options to push LAN traffic out the OpenVPN/PPTP tunnels so will need some manual tinkering (tomato does have the option via the GUI). If you can manually add the tun0 interface's on each DDWRT to the devices bridge, then broadcast data will be pushed over the tunnel to either side of the network.

Failing the bridge, you could try using pimd to route the data via the VPN tunnel. This has the benefit of not bridging the networks.

Another way might be using mrouted on the two dd-wrt boxes via the unicast static routing you setup, although it seems a bit dead development wise. If it does compile/work on linux still, it will allow you to route multicast data from each network via a TCP tunnel to the other network and vice versa which should work via the static routing without a tunnerl.

In any case, I think bridging is the only one I would attempt (unless you want to learn a lot about upnp and multicast). There's probably more than a couple of gotcha's with a protocol designed for a single home network.

Solution 2:

just add a static route on both routers,

if you have issues computers talking to each other, even if you sure that the route is set, make sure there is no local "Windows" firewall on the way, just disable it during the test, it can easily block pings even if your routes are set

also network discovery, you have to make sure that both machines from 2 different subnet have network discovery on.

if none of your steps are working that means those 2 Lans or 2 different VLAN's , but thats whole another topic..