Unusual NAT question

I have to configure a rather unusual network address translation scheme in a linux box;

These are the interfaces and information about them

eth0 - This interface has the IP address of with gateway
eth1 - This interface has the address of and is a NAT gateway itself which is connected to a single machine with IP
eth2 - This interface has the address of and connects to a private LAN

I wish to do the following operation with these three interfaces;

- [any] request from outside to eth0's local IP number must first be redirected to [that machine connected to eth1]
- The machine [] that gets redirected packets from must send them back**
!! But this is a different host, not the local IP number assigned eth0. This causes all the problem in this scheme now...

To simplify the issue I could explain the following;

Consider that there is machine with two ethernet ports:
- 1st Ethernet port has an address assigned as
- 2nd Ethernet port has an address assigned as

These two networks are not in the same subnet physically, they are separate networks:

In the subnet to which the 2nd ethernet port is connected, there is a host whose address is the same as, and this address of this host must not be changed. So there are two networks, and two different hosts on both with the same address.

What can I do to resolve the issue without changing the IP addresses. (Indeed if I change the addresses it would be very easy, but it will not be convenient for our current network. We are just trying to connect one network to the other through two hosts that have the same IP address.

Any urgent help would be greatly appreciated...
Who is Participating?
I think what you need is a second NAT box on the network with a static translation for the "other" machine. That way the box will be sending data to a address, which doesn't result in a conflict with the outside IP of this router.
XephyrAuthor Commented:
The exact configuration is as follows;

eth0 - I wish to use IP address as the own IP for the linux machine
eth1 - I wish to use IP address here which will send data to a different host but with the exact IP address I assigned to eth0

I tried this and it worked;

setting eth0 to and using IPTables -DNAT --to, redirecting requests from any host in eth0 to eth1

But I wish to use as my own IP address still and the system totally fails if I try to do as such. Perhaps there is a way to define that (loopback it becomes) has a default route to eth1 -->, not the machine's own loopback adapter.

I would wish to hear something soon... (Adding a second NAT box is impossible because we have no place to add another machine here, I tried to use a virtual machine, but since it has to use the routing table of again the main host, routing still fails)
If you define a given IP to an interface on this router you can't then send packets to another machine with the same IP that's connected to a different interface. In routing terms an IP is required to be unique meaning that there can be one ond only given IP "in view" of a node. So as stated you can't do what you are trying. The "other copy" of that IP would have to be hidden from the view of this router by a NAT device.
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.