Proxy-Arp setup with Keepalived
I currently am trying to create a setup with N servers where 1 server is the master for a Virtual IP, and the (N-1) servers act as backups, presumably controlled by keepalived
. However, one issue I see with keepalived
is that its intention is to bind the Virtual IP address (1.2.3.4
) to whatever interface I specified (let's call it eth0
).
What I intend to do, instead, is to create a Proxy-ARP entry on eth0
for 1.2.3.4
. This way, traffic headed to 1.2.3.4
comes to eth0
, and since ip_forwarding
is permitted on my host, routing table entries on the host will forward them to a virtual interface for further processing.
Is this use case supported within keepalived
? I did get this setup working properly with ucarp
, but this is mainly due to the fact that ucarp
has the concept of vip-up
and vip-down
scripts, where I can insert custom commands to create Proxy-ARP entries and send a GARP.
Why would you want this? As far as I know, it is not supported as VRRP is a protocol that needs to be able to talk between all participating hosts on the same subnet.
If you want to share a virtual IP address between several servers, and you want to attach it to a loopback interface, you should look at anycast routing. Run a routing protocol on your servers and on your routers (e.g. OSPF or BGP), let each server advertise the same IP address and make scripts that stop/start advertising the shared virtual IP address based on whatever you want, e.g. a service stops (e.g. Apache crashed) or the server loses/gains connectivity to a backend database etc.