connect two routers with different subnet

I've seen a lot of questions about this, but haven't really understood/didn't match my issue.

I'm a newbie regarding networking.

I got two routers, both are connecting to the wan (giving them different external IP).

192.168.0.1 is a vilfo and 192.168.2.1 is a dlink860l

is there anyway to connect those, so a computer on 168.0.x can access the printer (and other service) on 168.2.x (and vice versa)

The vilfo is special router for vpn, and are powered by LuCI lede-17.01, so it's highly customisable (if you know what to do (I don't))

I do have another router that's not used at the moment, if a bridge or something like that is necessary.

*edit: I just tested to put a network cable between the routers (lan port to lan port), but nothing really happened, so I did some other stuff. about 30 mins later I get a mail from my vilfo saying that as new unit had been discovered. Upon checking, I saw that it was the printer, on the other router that was detected..

I don't know why... but suddenly it just worked...*


Solution 1:

As @mohammed said in his comment, you should have a look at static routing.

Let's suppose the router A (192.168.0.0) wants to communicate with the network behind the router B (192.168.2.0).

Using static routing, you'll simply add an entry in the routing table on the router A to tell "if I have a packet for network 192.168.2.0, I'll send it to the router 192.168.2.1 using my interface xxx".

Don't forget to also create a static route on the router B (if you don't, the communication will be unidirectional).

EDIT: according to @JacobEvans comment, I'll add that you'll also need a network between your 2 routers. You can use a site-to-site VPN (maybe your Vilfo router can do it) or a peering network, but I'll recommend a VPN since it's simpler to create.

Solution 2:

If you're looking to merge the networks, why keep them split? Otherwise some systems that use broadcast discovery (like spotify, chromecast, apple play, etc) won't work between those networks.

I'd recommend just making the dlink an access point on your vilfo router, if you want some services to use direct internet calls, vilfo has documentation on split-tunneling.

Per the Manual

If you are connecting the DIR-860L router to an existing router to use as a wireless access point and/or switch, you will have to do the following to the DIR-860L before connecting it to your network: • Disable UPnP™ • Disable DHCP • Change the LAN IP address to an available address on your network. The LAN ports on the router cannot accept a DHCP address from your other router. To connect to another router, please follow the steps below:

  1. Plug the power into the router. Connect one of your computers to the router (LAN port) using an Ethernet cable. Make sure your IP address on the computer is 192.168.0.xxx (where xxx is between 2 and 254). Please see the Networking Basics section for more information. If you need to change the settings, write down your existing settings before making any changes. In most cases, your computer should be set to receive an IP address automatically in which case you will not have to do anything to your computer.
  2. Open a web browser, enter http://192.168.0.1 (or http://dlinkrouter.local./) and press Enter. When the login window appears, set the user name to Admin and leave the password box empty. Click Log In to continue.
  3. Click on Advanced and then click Advanced Network. Uncheck the Enable UPnP checkbox. Click Save Settings to continue.
  4. Click Setup and then click Network Settings. Uncheck the Enable DHCP Server checkbox. Click Save Settings to continue.