0

My home LAN is a rather standard 192.168.2.0/24 network with gateway on 192.168.2.1 and has DHCP on addresses from 100+ configured on an ASUS router (RT-AC66U). The WAN is configured via DHCP from ISP.

My goal is to access a machine at 172.16.5.31 on a 172.16.5.0/24 network, from any machine on my home LAN. I have physical access to the switch to which the machine is connected, but not to the router of that network.

To make a first step toward that goal, I took another router (dd-wrt) and configured a WAN network as 172.16.5.0/24 with WAN IP 172.16.5.37, and configured the LAN side as 192.168.2.0/24 with 192.168.2.98 IP. NAT is activated. No DHCP. No Gateway defined on either WAN or LAN. The WAN port is plugged into the switch residing on 172.16.5.0/24.

Setting up the network manually on a laptop with IP 192.168.2.67 and gateway 192.168.2.98, going exclusively through that dd-wrt works very well. But I want to use that dd-wrt to access the other network as a component in my home LAN. So I connected the LAN sides of the two routers together, and created a static route on my ASUS router like so: Host IP: 172.16.5.31 , Netmask 255.255.255.0 , Gateway 192.168.2.98 (dd-wrt LAN IP), Interface LAN. But I then get an unreachable host error with that configuration.

My idea was to have a device making a request to 172.16.5.31 with packets going to the usual home LAN router which would redirect to the dd-wrt router (static route), which would then do NAT, and route the reply packets back to the device. However this is not working and I am wondering what I am doing/assuming wrong.

Network overview

  • 1
    Where is the machine 172.16.5.31 physically located? If it is not directly connected to your dd-wrt machine, you'll need to establish a VPN connection between dd-wrt and the remote network. – user4556274 Jul 23 '16 at 11:29
  • The switch I have access to, is directly connected to the machine with IP 172.16.5.31, and connected to a router, which I can't access. It is another "local" network. I connected the WAN port of the dd-wrt router to that switch, so no need for VPN. I could connect 172.16.5.31 directly to dd-wrt, but then I would comprise functionalities of the existing network 172.16.0.0/16 – Squarepoint Jul 23 '16 at 12:51
  • What if you set a static route on the laptop 192.168.2.67 to access 172.16.5.x/24 via 192.168.2.98, does this work? – user4556274 Jul 23 '16 at 13:35
  • As I mentioned in the question, I connected the laptop 192.168.2.67 directly to the dd-wrt router and set laptop network interface gateway as 192.168.2.98 (didn't define a static route), and it worked with NAT. The home LAN router was not involved for this test. In my final setup, I would like all devices to have the home LAN router as gateway (to have access to internet), but I would like to route packets for the 172.16.0.0/16 network to go through the dd-wrt router, otherwise it will try will my ISP and fail because it's not there. – Squarepoint Jul 23 '16 at 15:06
  • As best I understand your setup, then, adding a static route to 172.16.5.x/24 via 192.168.2.98 to devices on your home LAN should be a workable solution. Leave the ASUS out of the setup. – user4556274 Jul 23 '16 at 15:08
0

It must work (except of possible ASUS firmware bugs)

But You set wrong static route, (I not know how ASU interprete Your settings):

Host IP: 172.16.5.31 , Netmask 255.255.255.255 , Gateway 192.168.2.98

or for access all 172.16.5.0/24 network

Host IP: 172.16.5.0 , Netmask 255.255.255.0 , Gateway 192.168.2.98

Second try:

If You need access from one (or some) PC, add static route at PC.

For windows (require run as administrator)

route -p add 172.16.5.0 MASK 255.255.255.0 192.168.2.98

For experiment You can skip -p key, then effect eliminated on reboot.

  • Out of curiosity, I reconfigured both routers and flipped their roles. The dd-wrt had DHCP, NAT for internet and routed 172.16.5.0/24 to the ASUS which had DHCP off and it's WAN on 172.16.5.0 . It then worked exactly as expected! Your answer is right, my initial setup should have worked, but apparently the static route implementation on the ASUS router wasn't working 100%. – Squarepoint Mar 24 '17 at 14:53

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.