How to Find Information about Droplet Anchor IPs

DigitalOcean floating IPs are publicly-accessible static IP addresses that you can assign to Droplets and instantly remap between other Droplets in the same datacenter. Implement a failover mechanism with floating IPs to build a high availability infrastructure.

Network traffic between a Floating IP and a Droplet flows through an anchor IP, which is an IP address aliased to the Droplet’s public network interface (eth0). Droplets must have an anchor IP before you can assign a Floating IP to it.

Droplets created before 20 October 2015 do not automatically have anchor IPs. Manually add anchor IPs to older Droplets to use floating IPs with them.

An anchor IP is only accessible to the Droplet it belongs to and the floating IP assigned to the Droplet. You should bind any public services that you want to make highly available through a floating IP to the anchor IP to prevent users from using the public IP addresses of your Droplets to bypass your floating IP.

For example, if you are using a floating IP in an active/passive load balancer setup, you should bind your load balancer services to their respective Droplet anchor IPs so they can only be accessed via the floating IP address.

Get a Droplet’s Anchor IP

To retrieve your Droplet’s anchor IP, you can use standard networking utilities, like ip addr show eth0. For simplicity, we recommend using the Droplet Metadata service by running curl on the Droplet.

To get a Droplet’s anchor IP, curl the anchor interface IPv4 address endpoint from the Droplet:

curl -s

You can similarly use the anchor IP netmask endpoint and anchor IP gateway endpoint.

Using metadata, you can also check if a Droplet has a floating IP with the active floating IP endpoint and get the address of its floating IP address with the floating IP address endpoint.

Learn more in the metadata API documentation.