Networking – How to interconnect two different LANs

lannetworkingrouterrouting

I have two different routers connected to different ISPs having different LANs. I want to set up the network in such a way that we can connect to devices on the other LAN or ping devices on the other network. One router has DHCP enabled. NAT is enabled on both of the routers.

I have tried putting in a static router but I am not sure if I am doing it right. I want to connect to computers, DVR and other devices. Right now I change 0 and 1 in the IPs to switch between networks. Is there a way to do it?

Router A's settings:
IP Address: 192.168.1.1
Subnet Mask: 255.255.255.0

Router B:
IP Address: 192.168.0.1
Subnet Mask: 255.255.255.0

(192.168.1.1)                      (192.168.0.1)
WAN 1> Router A> Switch1-----------Switch2< Router B(DHCP) < Wan 2
         |                                      |
Computers and Printer              Computers, IP Phones and DVR

Best Answer

You can plug a router in between Switch A and Switch B (from here on referred to as Router C, with ip addresses 192.168.0/1.254), and set up two static routes on the gateway routers to route between the two networks.

On Router A: A route to 192.168.0.0 with subnet mask 255.255.255.0 using the 192.168.1.x address of Router C

Example (Cisco IOS command): ip route 192.168.0.0 255.255.255.0 192.168.1.254

On Router B: A route to 192.168.1.0 with subnet mask 255.255.255.0 using the 192.168.0.x address of Router C

Example (Cisco IOS command): ip route 192.168.1.0 255.255.255.0 192.168.0.254

It is absolutely not necessary that this Router C be a Cisco device, I've simply included the Cisco syntax as it is what I am familiar with to be used as an example.

There may be a way to do this using just a cable connected between Router A and Router B if they have spare ports on them, but that would largely boil down to specifics about the capabilities of the routers you are using, while the above example should work on just about any equipment (I personally just ran a simulation in Cisco's Packet Tracer to make sure it was accurate).

Related Question