How to connect two separate networks together?

Arksun

Expert Member
Joined
Nov 1, 2010
Messages
1,803
Two home networks, each with their own gateway. Is it possible to connect these two networks together in a way that each device on their own network accesses their own gateway, but devices can communicate with devices on the other network as well?

Basically so the two houses can LAN games, but use their own Internet.
 

AstroTurf

Lucky Shot
Joined
May 13, 2010
Messages
30,534
Two home networks, each with their own gateway. Is it possible to connect these two networks together in a way that each device on their own network accesses their own gateway, but devices can communicate with devices on the other network as well?

Basically so the two houses can LAN games, but use their own Internet.

Give them different gateways
 

PsyWulf

Honorary Master
Joined
Nov 22, 2006
Messages
16,578
2x DHCP will be problematic
So some Manual IP magic is the way for simplicity
 

minkukel

Expert Member
Joined
Dec 27, 2004
Messages
2,371
How will the 2 lans physically connect ? wifi/network cable ?
 

syntax

Executive Member
Joined
May 16, 2008
Messages
8,656
Then you have 2 different subnet ranges.
on Gateway 1 route the other subnet to gateway 2
vice versa on Gateway 2

Your networks are now connected

Example
Gateway 1 towards Gateway 2 has 10.254.0.1
gateway 2 towards gateway 1 has 10.254.0.2

10.0.0.0/24 LAN -> Gateway 1 -> 10.254.0.0/30 -> Gateway 2 -> 192.168.0.0/24 LAN 2

on gateway 1 route 192.168.0.0/24 to 10.254.0.2
on gateway 2 route 10.0.0.0/24 to 10.254.0.1
 

Genisys

Honorary Master
Joined
Jan 12, 2016
Messages
11,217
How far apart is the networks? What equipment will you be using?
 

adam_g

Senior Member
Joined
Aug 18, 2011
Messages
906
Any type of Firewall will work pfsense, endian or mikrotik.

1 Lan 1 DHCP server 2 gateways with routing on the FW you can route the devices you want out the preferred gateway

so 1 LAN and 2 WANS

To me this is the easiest way.

Is this what you looking for?
 

Genisys

Honorary Master
Joined
Jan 12, 2016
Messages
11,217
Any type of Firewall will work pfsense, endian or mikrotik.

1 Lan 1 DHCP server 2 gateways with routing on the FW you can route the devices you want out the preferred gateway

so 1 LAN and 2 WANS

To me this is the easiest way.

Is this what you looking for?
Yes and no. Op will need a firewall to prevent using each other's WAN to get on to the internet. They will probably need a common address space they can use to only allow certain devices to communicate. OP can probably set up a VPN, or use Wireless. Without knowing all of the specifics such as hardware, ip ranges, how they want to connect to each other etc it is difficult to give advice. Options include using a similar setup to what Jawug uses, or if wireless isn't an option, maybe options similar to DN42's setup is an option.
 

syntax

Executive Member
Joined
May 16, 2008
Messages
8,656
Yes and no. Op will need a firewall to prevent using each other's WAN to get on to the internet. They will probably need a common address space they can use to only allow certain devices to communicate. OP can probably set up a VPN, or use Wireless. Without knowing all of the specifics such as hardware, ip ranges, how they want to connect to each other etc it is difficult to give advice. Options include using a similar setup to what Jawug uses, or if wireless isn't an option, maybe options similar to DN42's setup is an option.

a firewall wont be needed to prevent each other using their internet. Routing can do this.
there was also no mention of restrictions, but even a very basic router can edit a NAT rule or have a basic ACL to do this if required.
Im not sure why a common address space is needed either for sharing or LAN games. Routing again should be sufficient for this (I dont play games but i dont see why it would only work on a single broadcast domain)
 

Alton Turner Blackwood

Honorary Master
Joined
Apr 30, 2010
Messages
27,483
Then you have 2 different subnet ranges.
on Gateway 1 route the other subnet to gateway 2
vice versa on Gateway 2

Your networks are now connected

Example
Gateway 1 towards Gateway 2 has 10.254.0.1
gateway 2 towards gateway 1 has 10.254.0.2

10.0.0.0/24 LAN -> Gateway 1 -> 10.254.0.0/30 -> Gateway 2 -> 192.168.0.0/24 LAN 2

on gateway 1 route 192.168.0.0/24 to 10.254.0.2
on gateway 2 route 10.0.0.0/24 to 10.254.0.1
I might be missing something, but the way I see your solution is all the traffic will go to the other gateway router. He wants each to use their own internet connection for connecting to the net, but only be able to communicate with the other network when gaming.
 

syntax

Executive Member
Joined
May 16, 2008
Messages
8,656
I might be missing something, but the way I see your solution is all the traffic will go to the other gateway router. He wants each to use their own internet connection for connecting to the net, but only be able to communicate with the other network when gaming.

the default route still goes to the internet for each router's ISP link respectively
Only traffic destined for the other LAN subnet will go to the other router
 
Last edited:

RoganDawes

Expert Member
Joined
Apr 18, 2007
Messages
1,259
Let's start with what equipment is available, and how you are planning to go about this.

1. Ideally, you should have a dual homed device (something with two ethernet ports) acting as a router between the two home networks. This will allow each network to be mostly untouched, and internet access to continue unimpeded, if that cable/device is unavailable. The alternative of using only a single DHCP server for both networks would be problematic if the connection between them were to be broken for any reason. An example might be a cheap GL.Inet router running OpenWRT, configured with static addresses on each of the home networks, and configured to route packets between the two networks (but not to the Internet).

2. Each home network would need to use different subnets. e.g. 192.168.0.0 and 192.168.1.0.

3. To instruct the gaming machines that need to speak to each other directly how to do so, you would need to add a static route to the other home network on each machine. i.e. on gaming machine 192.168.0.101, the equivalent of "route add -net 192.168.1.0/24 gw 192.168.0.2" (where 192.168.0.2 is the address of the router), and similarly on any gaming machines on the other network. If you are wanting to game on things like Xbox or Playstations, you may need to see if your home router can be configured to include the route in the DHCP response (but I don't know if xbox and PS can even do direct gaming).

If you want to do it without the intermediate dual-homed router, it is possible (in particular, disable one of the DHCP servers, or else capture the MAC addresses of the devices that should get addresses from the various DHCP servers), but you will effectively be joining the two networks together, and will most likely have all traffic routed by only one of the upstream connections.
 

RoganDawes

Expert Member
Joined
Apr 18, 2007
Messages
1,259
Then you have 2 different subnet ranges.
on Gateway 1 route the other subnet to gateway 2
vice versa on Gateway 2

Your networks are now connected

Example
Gateway 1 towards Gateway 2 has 10.254.0.1
gateway 2 towards gateway 1 has 10.254.0.2

10.0.0.0/24 LAN -> Gateway 1 -> 10.254.0.0/30 -> Gateway 2 -> 192.168.0.0/24 LAN 2

on gateway 1 route 192.168.0.0/24 to 10.254.0.2
on gateway 2 route 10.0.0.0/24 to 10.254.0.1

This presumes that you can configure a separate routed network interface on each home router. If they were both running OpenWRT, (or even if only one was), I'd say sure, no problem, configure a port as a VLAN, give it an IP address in a new range, etc.

But I'd guess that someone already running OpenWRT on their router would not be asking this question :grin:

So, what equipment do we actually have to work with?
 

infscrtyrisk

Expert Member
Joined
Nov 22, 2014
Messages
1,296
Two home networks, each with their own gateway. Is it possible to connect these two networks together in a way that each device on their own network accesses their own gateway, but devices can communicate with devices on the other network as well?

Basically so the two houses can LAN games, but use their own Internet.

How will the 2 lans physically connect ? wifi/network cable ?

A cable connecting the two routers

Then it's simple. Add a static route to each router, informing it of the other network and the interface to take. The gateway of last resort/default gateway/route to the Internet will remain the same for all the hosts on the network. This is, of course, assuming that the two networks are not using the same RFC1918 range, in which case you would simply need to renumber one of them.
 

Arksun

Expert Member
Joined
Nov 1, 2010
Messages
1,803
Thanks for the input, guys. I'll give it a go and let you know the results.
 

Genisys

Honorary Master
Joined
Jan 12, 2016
Messages
11,217
And another option, even though not the best, get a new Network card for each PC, run the cable between the two computers, assign an IP on each side (for example: 172.16.1.1 and 172.16.1.2) and lan on that small two computer network. Won't allow you to easily expand, but is an option none the less.
 

RoganDawes

Expert Member
Joined
Apr 18, 2007
Messages
1,259
Also wanted to point out the elephant in the room, being that running an ethernet cable across an open space is asking for lightning damage to both networks. Unless you are planning to connect and disconnect the cable each time you game.

Much better would be a wifi link, or fibre.
 

Genisys

Honorary Master
Joined
Jan 12, 2016
Messages
11,217
Also wanted to point out the elephant in the room, being that running an ethernet cable across an open space is asking for lightning damage to both networks. Unless you are planning to connect and disconnect the cable each time you game.

Much better would be a wifi link, or fibre.
Agreed, lightning will love said cable. Fibre or WiFi will be better. PtP wifi kit is cheap.
 
Top