Networking – How to join two simple home networks together using an ethernet cable


I want to join two different home networks together like so:

PC A1      PC A2                              PC B1      PC B2
  \         /                                   \         /
   Gateway A      <----- ethr. cable ----->      Gateway B
       |                                             |
  ADSL modem A                                  ADSL modem B

Both networks are of the basic residential type with identical configuration, with all PCs running Vista/7. The point is to temporarily join two apartments in a building for gaming and file sharing, and the holy grail would be:

  1. PCs on network A can access PCs on network B and vice-versa (file shares and gaming).
  2. Each network uses its own internet connection.
  3. Data between networks shouldn't take a trip through the internet (broadband upload speeds are severely capped)
  4. A network's internet access should continue working if the joining cable is disconnected with minimal configuration changes.

How closely can this be achieved?

Best Answer

Since you don't want to go through the Internet, you don't want a VPN.

You need:

  • networks A and B to be different, non-overlapping IP scopes;
  • a router between the two networks; and
  • gateways that let you add additional routs.

The router needs to have two separate ethernet connecters on it. The reason for this is because if you are using DHCP on either network, you need to be able to isolate the DHCP traffic to the appropriate network. If you just glue the two networks together with an ethernet wire, there's no way to guarantee that PCs on network A wouldn't get DHCP from network B, and then use network B's internet.

So your network diagram would look like this:

PC A1      PC A2                              PC B1      PC B2
  \         /                                   \         /
   Gateway A         ------ Router -----         Gateway B
   |                                             |
  ADSL modem A                                  ADSL modem B

Then, Gateway A would have a route on it telling it that Network "B" was reachable via the A address on the router; Gateway B would have a route on it telling it that network "A" was reachable via the B address on the router.

Now if you have a Linux-based firewall as either Gateway, then you can probably just put another ethernet card in it and have that Gateway act as the router as well, but that's left as an exercise for the reader.

If one of the PCs involved is stronger than consumer-grade Windows and has multiple ports, I believe that it could act as the router too. I don't think XP or Vista can act as a router, though.

Also, if you have a more "business" level firewall as either gateway, you may be able to mark some ports as a different "security zone" and use that box as the router.

Note that the Linksys or D/Link "DMZ" functionality is NOT what I am talking about here.

But my guess is we are talking $50 cheapie firewalls here, so you are probably looking at scrounging another box to do this job.

As a short term fix, you could replace one of the Gateways with a small switch, disconnect the DSL from that side of the network, and run a long cable to the other apartment. Then reboot the computers on the now-disconnected side. That would make those computers join the other network, which means that for the duration of the game they'd be using the Internet from the other apartment, but it would at least let you play. ie:

PC A1      PC A2                              PC B1      PC B2
  \         /                                   \         /
   Gateway A         ------ cable  -----           switch
  ADSL modem A