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 linux servers in two different datacenters with the following IPs:

Server1: 4.4.4.4
Server2: 8.8.8.8 and 8.8.8.9

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

So if I run ifconfig i would get:

eth0   4.4.4.4
eth0:1 8.8.8.9

Is there any type of software that can do this?

Thanks.

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.

2  
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 8.8.8.9 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. –  lVlint67 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. –  Peter Horvath Aug 6 at 8:14

1 Answer 1

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

ip addr add 8.8.8.9/32 dev eth0

Will that do anything? Yes. It will probably break ALL communication between server1 and 8.8.8.9 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 (http://www.ietf.org/rfc/rfc3768.txt) 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 127.0.0.1 (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.