Floating IPs With VRRP: Shared Virtual IPs for Keepalived Failover

November 2, 2026 • Matt

If you’ve run high availability on Linux, you know the pattern. Two servers share a virtual IP, and VRRP decides which one holds it. When the active server fails, the standby claims the address within seconds, and clients keep connecting to the same IP. You can now build that on Cloud VPS. A floating IP attaches to several VMs at once, and keepalived moves it between them.

One address, shared by up to 64 VMs

A floating IP is an address on one of your networks, public or private, that isn’t tied to a single VM. You attach it to every VM that should be able to answer for it, up to 64 per address. Inside those VMs, keepalived (or whatever VRRP daemon you prefer) decides which one holds it.

This is different from moving an IP alias, which came with self-serve networking. You move an alias by hand in the client area. A floating IP is attached to every candidate VM ahead of time, so failover happens inside your servers in seconds, even at 3 a.m. when nobody is around to click anything.

Allocate a floating IP

Open your Cloud VPS service in the client area and choose Floating IPs. Click Allocate floating IP, give it a name, and pick a network. You can use your plan’s public IPv4 networks in Dallas or Philadelphia, or a private network you built.

Allocate floating IP dialog with a name field and a network picker

Standard IP pricing applies. A public floating IP is billed like any other public IP. Private networks have no IP fee, so a floating IP there costs nothing extra and gives an internal service, such as a database or a cache, one address that stays put.

Attach it to each VM in the pair

From the floating IP’s gear menu, choose Attach to VM, then pick the VM and its network interface. The address is added as an alias on that interface. The dialog only lists interfaces on the floating IP’s network, so you can’t pick the wrong one. Do the same for each VM that should be able to take over.

Attach to VM dialog choosing the VM and the network interface that receives the floating IP

The Floating IPs page shows each address, its state, which VMs it’s attached to, and how many of its 64 slots are in use. Detach removes one VM. Release floating IP gives the address back.

Floating IPs page showing one address attached to two VMs, with two of 64 slots used

Let keepalived decide who answers

Install keepalived on each VM and give them a shared VRRP instance. Here’s a minimal config for the first VM. It uses unicast, so the two servers talk to each other directly:

vrrp_instance web_vip {
    state BACKUP
    interface eth0              # the interface you attached the floating IP to
    virtual_router_id 51
    priority 150                # use a lower value, such as 100, on the standby
    advert_int 1
    unicast_src_ip 203.0.113.10 # this VM's own address
    unicast_peer {
        203.0.113.11            # the other VM's address
    }
    virtual_ipaddress {
        203.0.113.50            # your floating IP
    }
}

On the second VM, swap the two unicast addresses and lower the priority. Start keepalived on both. The VM with the higher priority takes the floating IP, and if it stops sending VRRP advertisements, the standby picks the address up a few seconds later.

VRRP on its own misses one common failure, though: a VM that is up while nginx or Postgres on it is dead. Add a track_script that checks the service itself, and keepalived will fail over for that case too.

Put the pair on separate hosts

A floating IP only helps if the standby survives whatever took down the primary. Add both VMs to an HA group and they will always run on different hosts, so one hardware failure can’t take out both.

Floating IPs are live now on every Cloud VPS, under Floating IPs in the client area.

About Matt

Togglebox editors and engineers publish practical guidance on cloud infrastructure, application hosting, and migration planning.

Take the next step

Launch infrastructure with hourly billing and high availability.