How can I join two networks

I need to join two networks like this:

PC A1 PC A2 PC A3 PC B1 PC B2 PC B3 \ | / \ | / ADSL MODEM/ROUTER A -------- ethernet cable? -------- ADSL MODEM/ROUTER B 192.168.2.x 192.168.1.x

What I want to do is to be able to access the network devices of network A from network B and vice versa. And I also want the devices to access the internet via the router on their respective network, for example PC A1 should access the internet via MODEM A and PC B1 via MODEM B.

So, I want things to stay as they are right now, adding the ability for PC A1 to "see" PC B1 etc. so I can transfer files between them etc.

4

4 Answers

If the networks are close enough that you can phsyically connect them with an ethernet cable, then simply do that. You'll need to add routes to each router to handle the different subnets (i.e., 192.168.2.x vs 192.168.1.x). For each router:

  1. Add a route for the other router out over the LAN interface.
  2. Add a route for the other subnet to go to the other router

For example on Router A, you should at a route for Router B's IP address (probably 192.168.2.1) over the LAN interface of Router A, and then you want to add a second route for 192.168.2.0/24 to Router B's IP address.

Repeat on router B, but with using Router A's IP and 192.168.1.0/24 as the subnet.


barlop's answer brings up some good points about DHCP and having two routers on the same physical network. While the above will get the packets to the right locations, look over his answer to make sure you have an idea how you want to deal with some of the complications that will arise from doing this.

4

Event if these two routers are physically connected, you'll need to setup the ports that the inter-router cable connects to differently from the others and then setup static routes.

Many home routers support neither. For the ones that do, you probably have to use the "WAN" port to connect the two routers (as the LAN ports are behind a switch chip and cannot be configured individually), which means you'll have no access to an external network unless you do a more complicated configuration.

Also, Windows file sharing host discovery (which I assume is what you mean for computers to see each other) does not work very well over different sub nets. You'll have to do some setup so the broadcast messages go through, which you probably can't on a home router. However, you can still access the files by entering the IP addresses directly.

You can connect Network A to a network switch, and Network B to a network switch.

Then connect each switch to a Central Router and configure the Router so one interface is for one IP range, the other for the other IP range.

And make sure DHCP isn't set on both routers. I suppose you either have to set the IPs manually to get the 2 different ranges. Or, get the central router to do the DHCP.

Those modem/routers most likely wouldn't cope with sending via DHCP one IP range on one port and another IP range on another port. My experience is they can't even cope with 2 different networks with 2 different IP ranges. But a central router (not modem-router) could and if not, then set IPs manually on each computer

That said.

You could perhaps look at it as one network 192.168.0.0 and configure both ADSL modem/routers that that's the network. Then you don't need a central router at all and can just connect them both together via ethernet cable. But then it's not two separate networks it'd be one network, but that's within the capabilities of your adsl modem-routers.

1

I would recommend adding a bridging router that would be connected to both networks. You can use pretty much any router with at least two Ethernet ports and that can run aftermarket firmware (like Tomato, OpenWRT, DD-WRT, and so on).

All you have to do in the router that connects the two networks it this:

  1. Configure each of two Ethernet ports into different VLANs.

  2. Assign each VLAN an IP address in one of your two networks.

  3. Connect each port to the network that port's VLAN has an IP address in.

  4. Make sure the router is configured to do routing. (This is the default in most distributions.)

Then, to make it work, you'll have to log into each of your two existing routers and add a route. For example, if the bridging router is 192.168.1.2 and 192.168.2.2, you'll need to add these two routes:

  1. In the 192.168.1.x network, a route to 192.168.2.0/24 with a gateway of 192.168.1.2

  2. In the 192.168.2.x network, a route to 192.168.1.0/24 with a gateway of 192.168.2.2

Note that computers in the two networks will be in different broadcast domains, so they won't easily discover each other. Depending on what tools you plan to use, there are various ways around this. For example, if you use Windows networking a lot, you can use a program (like nmbd) that synchronizes browse lists across the two networks.

2

Your Answer

Sign up or log in

Sign up using Google Sign up using Facebook Sign up using Email and Password

Post as a guest

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

You Might Also Like