One computer on 2 networks with same IP ranges

6

1

I have two networks:

Network A - 192.168.1.x with a router/gateway and cable modem Network B - 192.168.1.x with no gateway or internet acces

Both subnets are 255.255.255.0.

I have a computer with two network adapters - one connected to each of the networks (XP SP2). This computer runs an application that needs to use only the internet connection from network A and has to communicate with computers on network B.

Internet access seems to be unavailable when both adapters have a 192.168.1.x IP. I added a second router between the PC and network A's switch with an internal IP of 10.0.0.x and an external IP of 192.168.1.x.

This seems to be working Ok, but persistent connections sometimes drop. Is this an acceptable way to do this? Any way to eliminate the extra router?

Nick

Posted 2011-12-27T23:21:21.857

Reputation: 61

Renumber one of the two networks. – David Schwartz – 2017-09-11T19:40:16.620

Answers

4

You only have one network, which is 192.168.1.0 with netmask 255.255.255.0, this is classic Class C network (classfull), I think in your case may be happening ip duplicate, check the Ip's of your devices. Now would be good if you actually create another network, eg 192.168.10.0 with mask 255.255.255.0

Ielton

Posted 2011-12-27T23:21:21.857

Reputation: 3 351

More info: http://en.wikipedia.org/wiki/IP_address

– Ielton – 2011-12-27T23:35:46.810

3Umm, the distinction between classful and classless is irrelevant in a private network. But even if it wasn't: The distinction between classful and classless is about how (global) addresses are allocated, and not the sizes. While a newly allocated /24 network has the same size as a legacy class C network, that doesn't make it classful. – phihag – 2011-12-27T23:37:09.330

I mentioned in the text just as informative and to attract readers to learn about the term, and taking the opportunity of your comment I leave two links for more information:

http://en.wikipedia.org/wiki/Classful_network http://en.wikipedia.org/wiki/Classless_Inter-Domain_Routing

– Ielton – 2011-12-27T23:51:23.307

2

You cannot - in principle - have two devices with the same IPv4 address reachable from a single machine unless you perform some kind of address translation. It may work from time to time, but will regularily break.

I strongly suggest that you simply move either network A or B to 192.168.2.0/24.

If you must use the same IP ranges on both machines, adjust the routing table as follows, assuming the internet router on network A has the IPv4 address 192.168.1.1:

192.168.1.1/32 device A
192.168.1.x/24 device B
0.0.0.0/0      gw 192.168.1.1

You will not be able to communicate with 192.168.1.1 on network B. However, while this setup is possible, it will be error-prone in the long term, and I see absolutely no reason why you shouldn't just pick a different address range for either network.

phihag

Posted 2011-12-27T23:21:21.857

Reputation: 2 557

2

Unfortunately, there isn't an easy way around this. If you have one host on each network that has the same IP as the other, how does your computer know which one it is to talk to?

Apart from changing the address range you could set up your router to do a 1 to 1 NAT.

The only other real option might be to use subnetting

Matt H

Posted 2011-12-27T23:21:21.857

Reputation: 3 823