0

Quick background:

I am in China, and I am trying to setup two wireless networks on the same internet connection. One is a regular WIFI with a Chinese IP. The second should be using a VPN connected to the USA to access blocked and censored sites. For the VPN to work the router must be in gateway mode. If I remove gateway 1 and connect gateway 2 directly to the internet, everything including the VPN works fine.

So I need the following setup

internet---------[gateway 1]----192.168.1.2-----[gateway 2]------local network

The first wireless network works just fine. I then connect gateway 2 to gateway 1 thru cable. Gateway 2 is a DDWRT router with a normal DHCP setup, and the wan port correctly displays 192.168.1.2. If I connect to the second wireless network, I can not ping ex. 8.8.8.8.

On my laptop, I have manually tried to set the gateway IP to both 192.168.1.1 and 192.168.1.2, but I still have no access to the outside world.

Any idea? thanks!

1

It sounds like you're connecting the WAN port of gateway2 to a LAN port of gateway1. If you have the routers daisy chained this way, you will need to have a second private network on each router. e.g. change the network on the inside of gateway2 to 192.168.2.0/24. Routing will explode and behave erratically otherwise. (More specifically: the return path will never work right) So elaborating on your network diagram:

Internet ---- [NAT Outside IP|gateway1 inside 192.168.1.1/24] ----- [NAT Outside 192.168.1.2/24|gateway2 inside 192.168.1.0/24] (the NAT has the same network on the inside and outside)

But you need this:

Internet ---- [NAT Outside IP|gateway1 inside 192.168.1.1/24] ----- [NAT Outside 192.168.1.2/24|gateway2 inside 192.168.2.0/24]

Then your laptop uses an IP in 192.168.2.0/24, and gateway of e.g. 192.168.2.1.

  • Thanks both of you. Yeah, I got it working. Created 2 subnets, disable the firewall on gateways 2. Added a static route from one subnet to the other. So now I have a 10Mb/s WIFI connection to Seattle and a local Chinese WIFI as well. – Jens Nov 8 '14 at 5:14
0

I cannot say for sure, but your problem is probably related to routing.

Gateway 1 does not explicitly know that to reach the hosts behind gateway 2. The default routes will handle the rest of the traffic.

Try setting a static route in gateway 1 that routes traffic to the local network behind gateway 2.

Also, your local network and your intermediary network need to have different network addresses. It won't work if they are the same.

If you local network is 192.168.10.0/24 and the center port on gateway 2 has the ip 192.168.1.2 then your static route might be something like:

route add gw 192.168.10.0/24 192.168.1.2

Most of the time, the above command fails because the destination IP needs a route as well. Again, check my syntax, I think you need to do this before..

route add 192.168.1.2 ethX

This tells gateway1 where to find 192.168.1.2 (which interface)

Check my syntax... I haven't done a route command in a while.

If you can log into your ddwrt and run a tcpcump on the ports, you can usually see where your packets are hanging up.

Hope this helps!

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.