Two networks one pC

Usernameis

Honorable
Nov 22, 2013
36
0
10,530
Hi.
Is possible to access two networks with one pc (one nic).
Internal LAN and Internet gateway 192.168.3.1. And need to access to another LAN gateway 192.168.0.254,. where is server and main data.
We are two different companies, very close to each other by distance and sharing some data, so instead of using VPN, would be useful just connect through the LAN.
Thank you.
 
Solution
You have it close.

You would attach the cable on lan 2 with ip 192.168.0.2 to a switch port on lan 1.

The static routes would be 192.168.0.0/24 -> 192.168.0.254. Very technically you do not have to have this static route the traffic can run asynchronously but it is better if you have it. Some routers though decide to ignore this and go directly anyway.

and the static route on route1 would be

192.168.3.0/24 -> 192.168.0.2

You would have to put in a firewall rule between the 2 "lan" networks on router2 to prevent the data you do not want from crossing.
If you really mean just a single PC then the easy way is to use 2 nics and cable it to both networks. You would then remove the default gateway on the internal network and use the ROUTE command to send any other internal networks to that gateway.

If you mean you want to hook to lans together with multiple machines on each lan it gets complex. Mostly it will depend if your "router" can actually route traffic for more than one network or if it is restricted to a single lan subnet and wan address.
 

Usernameis

Honorable
Nov 22, 2013
36
0
10,530
It would be two LANs. One side ~50PCs connect to the main LAN, where are around 100PCs. We don't need both ways data exchange, only smaller LAN to get access to a bigger one.
I am thinking about add route to all 50 PCs manually. And it should short out this problem.
Lets say, every PC has IP address 192.168.3.2-192.168.3.52, mask 255.255.255.0, dg 192.168.3.1.
And in cmd at evry PC type this command: route add 192.168.0.0 mask 255.255.255.0 192.168.0.254.

what do you think?

and our LAN main switch just plug to other company's LAN. main switch.

 
So how would the PC know how to get to 192.168.0.254.

A not so good way would be to cable the lans together and then assign a secondary address in each pc in the other network. So each PC would have a address in each network...it could only have one gateway address though. This tends to be a huge pain to maintain.

The only way to do this is a router that can actually route traffic. Both routers need more than the very basic abilities. One router you would put on both networks. Say router has 192.168.3.1 and 192.168.0.100. This solve the issue for traffic coming from the .3 network going to the .0 network. Returning traffic has to be solved. You could either change all the PC on the 192.168.0.x network to use 192.168.0.100 or you would need to put in a static route on the 192.168.0.1 router telling it to send all the 192.168.3.x traffic to 192.168.0.100.

You will likely need to load dd-wrt on your routers to accomplish this. There are few if any consumer routers that support multiple lan networks.
 

Usernameis

Honorable
Nov 22, 2013
36
0
10,530


 

Usernameis

Honorable
Nov 22, 2013
36
0
10,530


 

Usernameis

Honorable
Nov 22, 2013
36
0
10,530


 

Usernameis

Honorable
Nov 22, 2013
36
0
10,530
Eventually decided to use router to do its best.
But need help with routing commands.
Currently is one - LAN1 192.168.0.1-255. dg: 192.168.0.254, static IPs, 50 our PCs connected to this network and about 100 from other our ex-company.
Soon we will have our own separate internet and local LAN2 192.168.3.1-255 dg: 192.168.3.2, DHCP, 50PCs.
So we need to access servers at LAN1. It sounds stupid, but this is the way our owners want.
We are close each other by distance. We will connect both routers with fibre optic cable. What commands do we need to add to accomplish this missioncommunication?

My thoughts are - at our LAN2 router R assign follow addresses to the ports:
fa0/1 Internet(NAT)
fa0/2 192.168.3.2
fa0/3 192.168.0.2

R: int fa0/2
R: ip static 192.168.0.1 255.255.255.0 192.168.0.2

at LAN1 and R1:
fa0/1 Internet
fa0/2 192.168.0.254
fa0/3 192.168.0.3

R1: int fa0/2
R1: ip static 192.168.3.1 255.255.255.0 192.168.0.3

1 Problem. It will be IP conflict at R1, two ports in the same subnet. The only solution I see at both routers to set port Fa0/3 ip addresses with subnet mask 255.255.255.252. But in this way, manually at some PCs in LAN1 need to change ip addresses and at everyone default gateway subnet mask to something 255.255.255.128 and lose many IP addresses.

2 Problem. It will allow all LAN PCs to reach our LAN2 PCs and vice-versus. We don't need to share printers, PCs and other stuff between two LANs. We only need to access data, programs and web servers at LAN1.

Please, direct me to correct way. I am feeling lost.
 
You have it close.

You would attach the cable on lan 2 with ip 192.168.0.2 to a switch port on lan 1.

The static routes would be 192.168.0.0/24 -> 192.168.0.254. Very technically you do not have to have this static route the traffic can run asynchronously but it is better if you have it. Some routers though decide to ignore this and go directly anyway.

and the static route on route1 would be

192.168.3.0/24 -> 192.168.0.2

You would have to put in a firewall rule between the 2 "lan" networks on router2 to prevent the data you do not want from crossing.
 
Solution