Connecting two subnets behind different routers

Hello! I have the following task. Two networks 192.168.0.0/24 on RouterOS and 192.168.13.0/24 on OpenWRT. The OpenWRT router is connected to the RouterOS router via a cable and receives internet from it. I need to set up routes correctly so that the computers in these two subnets can see each other.

How are the two routers connected to each other? Presumably the RouterOS device has the ability to set user specified static routes -- please confirm.

1 Like

OpenWRT router connected to lan port RouterOS router. Yes, it is possible to set static routes. But how can I do it correctly? The OpenWRT router receives a dynamic IP address from the RouterOS router. Should I reserve it or something else?

Should be static....
Do you need 2 routed subnets or you turn openwrt with a bridge + wifi?

Yes. And I can reserve ip address for OpenWRT router by mac address. And it always will receive the same address.

For example:

/ip dhcp-server lease
add address=192.168.0.54 client-id=1:70:62:b8:62:6b:c0 mac-address=\
    70:62:B8:62:6B:C0 server=dhcp1

Set static address on WAN port, not static lease.
You also need to uncheck the MASQUERADE box.

A static DHCP lease is fine... as long as the OpenWrt device remains at the same IP address.

The process is fairly simple:

  1. Create a static lease on the RouterOS device for: 192.168.0.0/24 via 192.168.13.x where x is the address of the OpenWrt (wan) on the RouterOS lan.
  2. Disable masquerading on the wan firewall zone in OpenWrt
  3. if you want full symmetric routing allowed, create a wan > lan forward in the OpenWrt firewall.

That is all that's needed.

I didn’t fully unerstand what do you mean.

Subnet on RouterOS device is 192.168.0.0/24, so may be you meant to add static route to 192.168.13.0/24 via 192.168.0.x .

And on the OpenWRT device I should to uncheck this masquerading

And in the last point I should also add here?

Yes, you're right. I accidentally reversed it when I read your initial post.

Correct.

If you click edit on the wan zone, you can add a forwarding rule to forward from wan > lan (allow forwards to ...). (Side note, you can also do it from the lan zone, in which case you're defining the allow forwards from).

Thank you for detailed instructions. It’s working!

Great!

If your problem is solved, please consider marking this topic as [Solved]. See How to mark a topic as [Solved] for a short how-to.
Thanks! :slight_smile:

This topic was automatically closed 10 days after the last reply. New replies are no longer allowed.