How do I bridge two wired DD-WRT routers?
I have one DD-WRT router (herein: 1st) connected to the Internet, working perfectly, with client PCs assigned static IP addresses.
Now I want to add another static client (herein: 2nd), but this time it's another DD-WRT router, not a PC.
That 2nd DD-WRT is intended to be a DHCP server, "fanning out" whatever is connected to it, such that the other (1st) router sees those client as coming from that single port/IP (say 192.168.14.31).
So far so good, but for some reason the clients that are connected through the 2nd router can't see the Internet.
If I connect a PC to that port assigning to it that static 192.168.14.31 address, it can access the Internet without any problem, so I know that the problem isn't in the first router. The problem is misconfiguration of the 2nd (client) DD-WRT router, as it simply doesn't know how to forward clients from its subnet (192.168.1.X) to the 1st router (192.168.14.1).
Using tracert
I have been able to verify that this is indeed the problem. But I don't know what (and how), out of the zillion settings in DD-WRT, to change.
I tried changing the Operating Mode
in Advanced Routing
from Gateway
to Router
but while this seems in the right direction, it didn't solve the problem.
Any idea what I should be doing in that 2nd router to tell it to start forwarding packets from 192.168.1.x to 192.168.14.1?
UPDATE 1: I managed to telnet into the router and print the routing table:
Kernel IP routing table
Destination Gateway Genmask Flags Metric Ref Use Iface
192.168.1.0 * 255.255.255.0 U 0 0 0 br0
192.168.14.0 * 255.255.255.0 U 0 0 0 vlan1
169.254.0.0 * 255.255.0.0 U 0 0 0 br0
127.0.0.0 * 255.0.0.0 U 0 0 0 lo
default 192.168.14.1 0.0.0.0 UG 0 0 0 vlan1
It's clear that the routing table is incorrect, but how do I change it on DD-WRT?
Also, I know what the WAN and LAN ports are, but what are br0
and vlan1
? How do I correlate them to the WAN and LAN ports? (I think br0
is one of the LAN ports and vlan1
is the WAN port but I am not sure)
UPDATE 2: I found an option to print the routing table from within DD-WRT's web interface:
192.168.1.0 255.255.255.0 0.0.0.0 LAN & WLAN
192.168.14.0 255.255.255.0 0.0.0.0 WAN
169.254.0.0 255.255.0.0 0.0.0.0 LAN & WLAN
0.0.0.0 0.0.0.0 192.168.14.1 WAN
Which tells me that, according to DD-WRT:
-
br0
==LAN & WLAN
-
vlan1
==WAN
(just as I thought)
Good to know. Now I need to solve this problem (I still have no clue): Make packets from the 192.168.1.x network reach the 192.168.14.1 gateway.
UPDATE 3: Insight. I think that the problem lies with the fact that the netmask for the 192.168.14.0
entry is not 255.255.0.0
. The problem is, there is no way to change it... I tried adding an explicit entry in the Advanced Routing tab:
Select set number: WTF
Route Name: WTF
Metric: 0
Destination LAN NET: 192.168.14.0
Subnet Mask: 255.255.0.0
Gateway: 192.168.14.1
Interface: vlan0
But the routing table remains the same even after applying, saving and rebooting!!!
I am beginning to suspect that there is a bug in this DD-WRT v24-sp1 (07/27/08) std
release.
Solution 1:
I was ready to give up and go back to stock firmware when I discovered a well hidden tip in the dd-wrt.com forums about Rosewill RNX-GX4 - Advertised as DD-WRT Compatible that instructs:
You could simply enter DD-WRT firmware and : go to "vlan option", uncheck the “W”column, then "save" and “apply”, then check “W” again then "save" and "apply" <====this could solve the WAN isn't work.
I tried exactly that and it solved all my problems.
Solution 2:
Is the 2nd router's WAN port set to something in 192.168.14.0/24? I believe it's in Setup and then under where it says "Router IP" The 2nd router's WAN port, or the "Router IP" must be in the same subnet as the LAN ports in the 1st router.
Solution 3:
The problem you're seeing is called Double NAT.
What I would do here is make the 1st router the DHCP server. Really. Just make sure it's handing out IPs that don't conflict with any of your existing static devices. Then, run a cable from a LAN port on the 1st router to a LAN (not WAN) port on the 2nd router, and disable the DHCP service on the 2nd router. This should do almost everything that you want, except that now all devices will likely be in the same subnet. If you're trying to create a kind of guest network, and your router supports it, you can still do this by using a different subnet mask for the dhcp server.