Allow traffic to devices connected to different subnet

I'm sure this has been asked before and I have done a ton of searching and reading but I'm not understanding, perhaps someone can point me in the right direction.

Scenario:

Router #1, 192.168.20.000
Router #2, OpenWRT, connected to router #1 as a DHCP client, it ends up with an address of 192.168.20.15 (for example)

If I connect to router #2, all is normal, I can connect to devices that are connected to it (as expected) and I can also connect to devices on router #1, which is also what I want.

If I connect to router #1 I can not connect to devices on router #2 and I want to be able to.

I've tried various firewall settings and read a lot about static routes but I don't think I'm understanding either.

I want devices connected to router #2 to get IP's via DHCP from router #2 but I want to be able to connect to them in I'm connected to router #1.

You need a static route on Router #1 to the subnet behind Router #2 via your OpenWrt router's "WAN" port (which I would assign a fixed IP to, so that you can easily up that static route).

Router #1 knows that 192.168.20.0/24 is out its LAN. "Everything else" (typically) goes to your ISP's router. It has no idea that there is anything "behind" Router #2 unless you "tell" it with that (static) route.

(If you don't need a second subnet behind Router #2, you can always set it up as a bridge.)

2 Likes

That sucks because I don't have access to router #1 and if I bridge them then it will assign IP addresses from router #1 which could potentially not have enough left in the pool.

Thanks for the answer, at least I know now.

1 Like

There's an exceptionally unlikely possibility that Router #1 will accept IPv4 routing protocols, but so slim it probably isn't worth the time to pursue. You might have better luck with IPv6 router advertisements, but that wouldn't help the IPv4 situation.

1 Like

I did read a bit about the protocol and agree, not worth pursuing.

Thanks for clearing it for me Jeff!

If the machines connected to #1 that need access to those behind #2 are under your control, you could give each of them the route

Hi,

You can try setting up port forwarding on router #2, assuming that the router below the subnet is 192.168.1.100 and the forwarding port is 1234, accessible through 192.168.20.15:1234

1 Like

Other alternatives are adding static routes on the devices you have connected to router #1 or use a VPN you set up on router #2.

2 Likes