I'm trying to configure routing between two networks with the same address. They are connected through a router with 2 NICs (Linux machine).

Consider the figure above: How may I configure the routing so that a request from on the right made to goes to on the left?

enter image description here

Thank you all for your valuable input so far.

Maybe I can add another router to create a intermediate network like in the figure above. The question is if I can do that physical I can do it logical in one router?

enter image description here

8 Answers 8


In the first diagram you can connect each segment using proxy arp or bridging. In the second diagram you might be able to bridge the segments using GRE.

As everyone else emphatically states you should avoid this sort of thing if possible.

  • 1
    But that doesn't help because both networks have a address that he wants to send traffic between.
    – rjmunro
    Jul 5, 2011 at 11:04
  • You're absolutely correct. For identical addresses on each segment you'd have to resort to mangle the packets as you describe below. Jul 6, 2011 at 15:41

It won't work. There is no way to send a packet to another machine with the same address ( The traffic will be routed directly to the loopback address and won't even leave the system. Your diagram shows an addressing conflict. Personally, I would change the address on the right to a different address.

You could use DNAT to make on the left appear as a different address and route to it. This is done when bridging private networks from different organizations. The appropriate DNS overrides on the local DNS servers are required so that the servers can be reached by name.

EDIT: You need a router where you can configure DNAT individually by interface. Linux based routers should work, but I don't think dedicated routers have this capability. Typically, NAT is handled by firewall devices. Linux routers generally combine routing and firewall capabilities.

EDIT2: When you are configuring a network which is likely to be connected to others internal networks it is best to use less popular sub-nets of the block, or a block in one of the alternate private networks,, or Pick a random number between 4 and 255 for your sub-net (second octet for, third octet for the others). If you use the range pick a random value between 17 and 31 for the second octet as well.

If you distribute addresses using DHCP, you should be able to change the sub-net relatively easily. You may want to route the old sub-net while the addresses are changing over.

  • "It won't work.", i fear that. The point is, the right is customers network and the left (router including) our equipment. As is very popular i was trying to get a general solution to avoid network address clashes configurable from one point (router) ...
    – PeterMmm
    Jul 4, 2011 at 14:15
  • 3
    it will link not work, because at least two computers in this scheme have ip-address! Jul 4, 2011 at 14:24
  • It is a full Linux distro with full toolbox: iptables, tunnel, etc
    – PeterMmm
    Jul 4, 2011 at 15:31
  • See the Shorewall article on Bridged Firewalls shorewall.net/bridge-Shorewall-perl.html for a start on your setup.
    – BillThor
    Jul 5, 2011 at 13:17

Based on your comment to the answer from BillThor, I would suggest to renumber one of the networks ASAP. Whilst you may be able to get this working somehow, it is always going to be a perfect PITA and will haunt you. This is the exact reason why I NEVER configure any network on

The renumbering is easiest to achieve if one of the networks is completely configured through DHCP. Change the DHCP configuration, change the fixed addresses of the DHCP server, then restart every single computer on the network, done. It's well worth the effort.


This could work with some really heavy NATting and a lot of work, testing and (probably) errors; but it will be difficult to setup and a pain to manage in the long run.

I strongly suggest avoiding it, if you can.


Double NAT might be the answer, as described in this HOWTO:



Your scheme and your question is absolutely uncorrectly. You're talking about two subnets with the same address and you want to make routing between some subnets. Please, think of what and how you want to do and then Reframe the question.

  • 3
    The question is perfectly fine, the OP knows this doesn't usually work, he was just asking if there is some way to make it work even if it shouldn't; and there actually are ways to do that, only they are extremely unusual and convoluted; but I know of at least one large production network where this was made necessary by a company merge. It's really ugly and difficult to manage, but it works.
    – Massimo
    Jul 4, 2011 at 14:43

I'm posting this as a new answer because it's a completely different approach, but it could work and save your day.

If all addresses are on the same subnet but you can make sure there is no conflict (i.e. you can change one of those two, then bridging the two networks would be the easiest solution. You could use a PC with two network cards in a bridge configuration, or just connect the two networks with a simple switch (or even only a cable).

If you only have few conflicting addresses, you should be able to sort them out; of course, if both networks are 90% full, this is not a viable solution.


In your second scenario you could possibly NAT the entire second network to a, IE would go out your natty router, be sent to their natty router, then NAT to on their side.

If it even works it will be as much work as just changing the network enumeration on either end really.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

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