By ryanUrchin
I just setup a droplet and assigned it a floating IP. I believe it should be possible to configure the OS (Ubuntu in my case) to use that floating IP for all outbound connections instead of the anchor IP, I just don;t know how to accomplish this.
I need to do this reliably because I am connecting to an external API that requires connections to come from a whitelisted IP. And changing the whitelist is a slow manual process so my hope is to use the floating IP to ensure it shouldn’t have to be changed even if I have to rebuild the server or something.
This textbox defaults to using Markdown to format your answer.
You can type !ref in this text area to quickly search our full set of tutorials, documentation & marketplace offerings and insert the link!
Hi @ryanUrchin,
I believe I met a problem similar to yours and found two workarounds to it. Before I share them I would need some clarification from you.
You wroteI believe it should be possible to configure the OS (Ubuntu in my case) to use
that floating IP for all outbound connections instead of the anchor IP
I am pretty sure you mixed up your droplet’s anchor IP with its public IP. It would not be possible to communicate across the internet with an anchor IP as a source one. An anchor IP belongs to ipv4 range that is designated to private (local) networks. You can retrieve your droplet’s anchor IP executing a command below (due to the appropriate DO’s doc):
curl -s http://169.254.169.254/metadata/v1/interfaces/public/0/anchor_ipv4/address
Is that right, or I misunderstood your description ?
No I think you are mistaken as to what the anchor IP is.
“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).”
https://www.digitalocean.com/docs/networking/floating-ips/how-to/find-anchor-ips/
In any case. The point is to use the Floating IP for outbound connections. Which I did ultimately find a bash file to configure this here: https://gist.github.com/eagafonov/5c57bfbe353a9c93a94c
Get paid to write technical tutorials and select a tech-focused charity to receive a matching donation.
Full documentation for every DigitalOcean product.
The Wave has everything you need to know about building a business, from raising funding to marketing your product.
Stay up to date by signing up for DigitalOcean’s Infrastructure as a Newsletter.
New accounts only. By submitting your email you agree to our Privacy Policy
Scale up as you grow — whether you're running one virtual machine or ten thousand.
Sign up and get $200 in credit for your first 60 days with DigitalOcean.*
*This promotional offer applies to new accounts only.