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!
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.
Click below to sign up and get $200 of credit to try our products over 60 days!
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!
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.