Report this

What is the reason for this report?

How to use floating IP as OpenVPN origin IP on Ubuntu 16.04?

Posted on January 25, 2017

I am configuring an OpenVPN server on a DigitalOcean droplet. I have assigned a Floating IP and would like the server to yield it as the origin IP. Right now, if I connect through the VPN and go to whatismyip.com, the origin IP shows the anchor IP, not the floating IP. How do I change this?



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!

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.

@hbridges

How was the VPN setup? Did you use an auto-installer or perform the setup by hand?

If the VPN was setup using an auto-installer, the vast majority of the time they are configured to use the primary IP of the server. Even if you can connect using your floating IP, the origin will still be the primary.

To change the IP that your VPN actually uses for connection, you’d need to find out where the config file(s) is/are for your setup and scan for the IP that was set for use. You would them replace any/all instances of the primary IP with the Floating IP.

That being said, if you’re only running a single VPN instance, you don’t really need a Floating IP. They are really meant to simplify load balanced solutions, not act as a secondary IP for the Droplet. I’m not entirely sure what you’re setting up, just making a general note as to what they are actually designed for versus what I’m reading over :-).

This is the answer you are looking for: https://blog.programster.org/openvpn-digitalocean-ip-alias

The developer cloud

Scale up as you grow — whether you're running one virtual machine or ten thousand.

Get started for free

Sign up and get $200 in credit for your first 60 days with DigitalOcean.*

*This promotional offer applies to new accounts only.