Hi I am accessing the internet from home through an openvpn server running on a digital ocean droplet. I also set up a web server on the same droplet.
Now if I try and ssh to the IP address or access the IP address through the VPN the various commands/accesses just hang.
If I turn off the VPN I can access everything just fine.
I appreciate this is probably something to do with routing on the droplet site. I’d be grateful if someone could give me a pointer as to what I need to do to enable access through the vpn and from another machine without the vpn. Thanks Andrew
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.
Hi,
I think your issue may be related to firewall’s NAT settings on VPN server side. I changed my VPN configuration to simulate yours. Now it looks like in the diagram below.
I can ssh Droplet 1 and get a website served by its from my home office network. VPN channel is up, of course, and I use droplet’s public IP address.
I have installed and configured nftables on Droplet 1. My NAT settings for the traffic outgoing from VPN network to the Internet looks like that:
I hope it will get you closer to solving your issue. I probably could help you more if I knew more details of your configuration.
Hi, thanks so much for the detailed reply. I’m spending a bit of time getting used to the nftables and reading around the subject. I have been using an edgerouter x and thought I was getting used to that. Each system seems to be completely different.
I shall let you know how it goes. May I ask what you used to generate the fancy ascii diagram.
You are welcome :)
I will appreciate it.
Gnome Text Editor - gedit :D
Well, I added the outgoing chain to a file as follows
I also replaced the first line with table ip nat
Unfortunately it hasn’t made a difference to my ability to connect to the server.
I have just noticed that if I am on one of my devices that uses the vpn then I can access the server using https://10.8.0.1. However I want to access it using the fixed IP address 161.x.x.x from the internet side. I presume I need some rule to change the destination address from 161.x.x.x to 10.8.0.1 for traffic from the VPN.
saddr 10.8.0.1 oiaddr
Thank you for the diagram :) . It directed me to the correct path for troubleshooting the problem. Before, I precipitately assumed that you use OpenVPN client installed on the PC you connect from. I dug deeper into my configuration and figured out the route set up on PC 1 (VPN Client/Gateway) that send the traffic to VPN server via my Home Office Internet Gateway, not through VPN tunnel. I removed that route, just for test, but it broke all the communication. I think OpenVPN client needs it to keep the connection. So, if it is OK to you to reach your droplet’s resources outside VPN tunnel, you can add the static route to your Asus router configuration. Using Linux it would be like
BTW. Can you share what is the model of your Asus router ?