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 multiple debian servers on which I configured "IP Failovers" or "Floating IPs".

My floating IP is 10.0.0.2 and I have an A records: www.example.com pointing to this IP.

I configured this floating IP on all my servers with the command:

ip addr add 10.0.0.2/32 brd 10.0.0.254 dev eth0 label eth0:0

Now, let's say my IP Failover currently points to server-1. We could represent this like this:

                                  _  _
                                 ( `   )_
                               (    )    `)
                              (_   (_ .  _) _)
                                    |    
                                    |
                                    |
                            |--------------|
                            |  10.0.0.2    |
                            |--------------|
                               /      
                              /        
                             /          
             |--------------|            |--------------|
             | server-1     |            | server-3     |
             | IP: 10.1.1.1 |            | IP: 10.3.3.3 |  
             | IP: 10.0.0.2 |            | IP: 10.0.0.2 |  
             |--------------|            |--------------|  

Let's connect to server-3 and ping www.example.com:

$ ping www.example.com
PING www.example.com (10.0.0.2) 56(84) bytes of data.  
64 bytes from 10.0.0.2: icmp_req=1 ttl=64 time=0.022 ms 
64 bytes from 10.0.0.2: icmp_req=2 ttl=64 time=0.012 ms 
64 bytes from 10.0.0.2: icmp_req=3 ttl=64 time=0.013 ms 
^C                                                              
--- www.example.com ping statistics ---                        
3 packets transmitted, 3 received, 0% packet loss, time 1998ms  
rtt min/avg/max/mdev = 0.012/0.015/0.022/0.006 ms

So that's perfect, except 1 detail: the machine answering the ping in the output above is not server-1, it's server-3

It makes complete sense; 10.0.0.2 is a local address to server-3

So here's my question:

How can I configure 10.0.0.2 on all my servers, yet, "disable" it on servers which the IP Failover is not pointing to?

Thank you for your help

share|improve this question
    
Youll get IP address conflicts bring up the address on all 3 servers. Something like keepalived.org is what you want. –  Matthew Ife Feb 11 at 1:09
    
Let's say I can't use keepalived. Is there a way with the "ip addr" command or something else to "configure" a secondary IP, but tell the system to ignore it until... I run a command to tell the system "stop ginoring it". –  liquidity Feb 11 at 1:13
    
Nope, and anyway how will you tell 1 of the 3 systems to stop ignoring it without making the other two stop ignoring it at the same time? KeepaliveD is meant for this purpose. –  Matthew Ife Feb 11 at 1:31
    
I'm not sure I'm following you. My setup is not complex. There's no reason why the 2 other systems would also start ignoring it. –  liquidity Feb 11 at 2:13

Your Answer

 
discard

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

Browse other questions tagged or ask your own question.