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.

These answers are provided by our Community. If you find them useful, show some love by clicking the heart. If you run into issues leave a comment, or add your own answer to help others.

×
2 answers

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 wrote
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 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 ?

Show answer This answer has been marked as resolved by ryanUrchin.
Submit an Answer