HAProxy community

Using Keepalived (VRRP) for source IP failover


In my case, I need my HAProxy to use a specific source IP when connecting to any of the back-end servers. I’m currently using keepalived for automatic failover and switching over an IP from BACKUP to MASTER. If I don’t have an IP binded to the backup, then the backup will basically log a whole bunch complaining it can’t use the IP that’s supposed to be dynamically binded to it.

Is there a way I can configure it so HAProxy doens’t complain? Is it bad practice to leave HAProxy running with an IP it can’t use? I’m just wondering if there’s a better/cleaner way to achieve what I want that won’t spam my server with error logs.


To bind to a non-existant IP on your frontend, use the transparent bind keyword.

I’m not sure what this has to do with the source IP haproxy uses to connect to your backend: that is supposed to be the actual, physical IP address configured on the haproxy server, not the failover IP.