Server Fault is a question and answer site for system and network administrators. It's 100% free, no registration required.

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I have two linux servers in two different datacenters with the following IPs:

Server2: and

I need to route all traffic from (Server2) to (Server1) but in way that Server1 would see as a local ip.

So if I run ifconfig i would get:


Is there any type of software that can do this?


Additional details

The reason why i'm trying to do this is a bit complex. I will try to summarize.

I have a mail server in Server 1 and Server 2 ( currently a relay for Server 1 ).

The logs of this mail server are processed by a software (closed source, company who makes it is out of business) which provides some useful information to the company that I work. But it can't capture data for the relayed emails. Maybe some missing fields/data, I don't know for sure.

I have two options:

  1. Write a new software ( expensive )
  2. Be able to assign the IP in Server 1 to make it work as a local IP. This way I don't have to use the relay anymore, and the old software should be able to process logs normally.
share|improve this question

closed as unclear what you're asking by pauska, MadHatter, Khaled, voretaq7 Sep 24 '13 at 15:05

Please clarify your specific problem or add additional details to highlight exactly what you need. As it's currently written, it’s hard to tell exactly what you're asking. See the How to Ask page for help clarifying this question.If this question can be reworded to fit the rules in the help center, please edit the question.

Could you give a bit more detail about what you want to accomplish? Based on the information already given, I'd have to say the answer is "no", but more information might help change that. – John Sep 24 '13 at 13:12
Why do you need to exist on server 1 and server 2? I also suspect you are trying to accomplish something that would be better solved with a different approach. – Daniel Widrick Sep 24 '13 at 13:14
@John I just edited the question to try to explain why i'm doing this in a few phrases. – Fernando Sep 24 '13 at 17:12
It was a good question and I think it was unfair to close. – peterh Aug 6 '14 at 8:14

Yes. You can assign whatever ip address to whatever server your administer.

ip addr add dev eth0

Will that do anything? Yes. It will probably break ALL communication between server1 and at server2. Otherwise, in the current config, you won't gain anything but a silly, broken, and non-standard setup.

What you are asking for looks familiar to the stuff that VRRP ( that is used to assign a single IP address to two nodes connected to shared routers (See: On same subnet). This is popular in keepalived and LVS setups.

With that in mind, the general way to setup failover in diverse datacenters (without breaking the internet as we know it) is to use DNS as the failover mechanism.

If for some reason you need traffic to appear local...

You could look into using iptables to mangle the packet and redirect the traffic to (or an arbitrary local ip address)

share|improve this answer

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