By jwilliamson
I have an openvpn server on a third party network. I want to connect a droplet server to a NAS on the VPN, but whenever I connect to the vpn from my droplet, I can no longer access the server. Why is that? How can I setup my droplet server to be able to connect to the vpn, while maintaining the server connections and services it normally hosts?
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!
Select Create OpenVPN Access Server Droplet from the menu. Select a plan and datacenter for your droplet on DigitalOcean. Decide on your authentication. Add tags, choose a project, pick any other parameters, and alter the droplet’s hostname if necessary. To create a droplet, click.
When connecting your Droplet to a VPN, it’s common to lose external connectivity if your VPN configuration pushes a default route to the client. This causes all your Droplet’s traffic to be routed through the VPN, affecting your server’s regular connections and services.
To fix this issue, you should configure your OpenVPN server to provide only specific routes to your Droplet. This ensures that your Droplet maintains its connections and services while still accessing the NAS over the VPN.
On your OpenVPN server configuration file, comment out or remove the line “push "redirect-gateway def1"” if it exists. Then, add a line with the specific network route to the NAS, like this:
push “route nas_network_address netmask”
Replace nas_network_address and netmask with appropriate values for your network.
After making these changes, restart your OpenVPN server and reconnect your Droplet to the VPN.
For more information on configuring OpenVPN, you can refer to the following DigitalOcean tutorial: How To Set Up an OpenVPN Server on Ubuntu 20.04.
Hope that this helps!
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.