Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

I have two networks with the same IP addresses in use and I need to connect them.

I have a third network between the two to connect them but I need to know : - is it possible to communicate iof the IP are the same on both side ? - Which technology to use to configure the router to achieve this ? Do I need NAT, or something else ?

Example : I have network A in 192.168.1.0/24 with one machine 192.168.1.10 I have network B with the same configuration I have a third network C in 192.168.222.0/24 connected to A and C with routeurs How to access the machine on network A with the one on network C ?

share|improve this question

migrated from stackoverflow.com Aug 17 '12 at 8:55

This question came from our site for professional and enthusiast programmers.

add comment

1 Answer

It's very, very ugly. The simplest way is to construct a bridging network with two routers in it, with those two routers connected in the bridging network.

Each bridging router NATs 192.168.1.0/24 to a different /24 inside the bridging network. Assuming 192.168.10.0/24, 192.168.11.0/24, 192.168.3.0/24 are free and 192.168.1.251 is free in each network:

Router 1 works as follows:

  1. Router 1 is assigned IP address 192.168.3.1/24 in the bridging network and 192.168.1.251 in its own network.

  2. Router 1 has a connection to one of the 192.168.1.0/24 networks and NATs 192.168.1.x to and from 192.168.10.x

  3. Router 1 has a route for 192.168.11.0/24 with a next hop of 192.168.3.2 in the bridging network.

Router 2 works as follows:

  1. Router 2 is assigned IP address 192.168.3.2/24 in the bridging network and 192.168.1.251 in its own network.

  2. Router 2 has a connection to the other of the 192.168.1.0/24 networks and NATs 192.168.1.x to and from 192.168.11.x.

  3. Router 2 has a route for 192.168.10.0/24 with a next hop of 192.168.3.1 in the bridging network.

In this way, machines on the 192.168.1.0/24 network connected to router 1 can access machines in the second network by using 192.168.11.0 addresses. Vice-versa for the other network, using 192.168.10.0 addresses.

The default router in each network must be configured to route packets for 192.168.10.0/24 and 192.168.11.0/24 to 192.168.1.251. The routers can be cheap wireless routers running OpenWRT, Tomato, or DD-WRT. These routers can also be used for other purposes. For example, if they're already the default router for their 192.168.1.0/24 network, the configuration is slightly simpler.

While it should be possible to do this with a single router using both SNAT and DNAT, I've never gotten it to work. Others I know have reported similar issues. I believe it's because the ARP system can't handle two distinct ARP entries for the same IP on distinct interfaces.

share|improve this answer
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.