How can I set up a webserver behind two routers?

  1. A separate IP range is unnecessary, this will work without it as the firewall sits between the cables.

  2. Your main router should forward to the web server and not to the firewall.

  3. Your firewall should accept any source address, the main router does not overwrite source address.

    This also allows access from your family machine.

  4. Your firewall should also allow traffic going to the other side.

  5. Use Can You See Me and Wireshark for more detailed troubleshooting.


Right, I have finally worked this out and got it as I wanted. Instead of the m0n0wall box forwarding packets twice I've moved to changed subnets. I now have a DD-WRT-based Linksys E1000 acting in "Client Mode", so that it acts as a "client" to the family wireless and has a DHCP/DNS server serving the wired connections on the development network. I have changed the subnet mask to from 255.255.255.0 to 255.255.252.0 on the Belkin router and on the DD-WRT. The belkin is on 192.168.2.1 and DD-WRT on 192.168.1.1. Machines on each network can see each other, so if I set a machine on my dev network with a static 192.168.2.x the Belkin will be able to port foward to it.

Diagram Time: enter image description here

I have no idea if m0n0wall is able to forward packets, but subnetting seems to have been the easiest way of going about this.

I can reccomend Wolfram Alpha for easy-to-use subnetting info.