LightYear
/Docs
DocsNetworkingFloating IP Addresses

Floating IP Addresses

Assign a floating IP to your server for seamless failover and zero-downtime migrations.

intermediate
5 min read
LightYear Team
Updated April 24, 2026
floating-ipfailoverhanetworking
Ready to get started?

What Is a Floating IP?

A floating IP is a static public IP address that can be instantly reassigned between servers. Use it to:

  • Perform zero-downtime server migrations
  • Implement manual failover between primary and standby servers
  • Maintain a stable IP while replacing the underlying server

Reserving a Floating IP

  1. Go to Network → Floating IPs → Reserve IP.
  2. Choose a region.
  3. The IP is reserved immediately.

Cost: $0.005/hr (~$3.60/month) while reserved but unattached.

Attaching to a Server

  1. Go to Network → Floating IPs → [Your IP] → Attach.
  2. Select the target server.
  3. The IP is routed to the server within seconds.

Configuring the OS

The floating IP must be configured on the server's loopback interface:

>_BASH
$# Ubuntu 22.04
$ip addr add <FLOATING_IP>/32 dev lo

Make persistent:

>_BASH
$cat >> /etc/netplan/99-floating.yaml << EOF
$network:
$ version: 2
$ ethernets:
$ lo:
$ addresses:
$ - <FLOATING_IP>/32
$EOF
$netplan apply

Failover Script Example

>_BASH
$#!/bin/bash
$# Run on the standby server to claim the floating IP
$
$FLOATING_IP="203.0.113.100"
$SERVER_ID="your-standby-server-id"
$API_KEY="your-api-key"
$
$curl -X POST "https://api.lightyear.host/v1/floating-ips/$FLOATING_IP/attach" -H "Authorization: Bearer $API_KEY" -d "server_id=$SERVER_ID"

Was this article helpful?

Your cookie choices for this website

This site uses cookies and related technologies, as described in our privacy policy, for purposes that may include site operation, analytics, and enhanced user experience. You may choose to consent to our use of these technologies, or manage your own preferences. Cookie policy