Access database on Windows server through VPN from nodejs running on Linux Access database on Windows server through VPN from nodejs running on Linux linux linux

Access database on Windows server through VPN from nodejs running on Linux


Unless something else is specified, a Windows based VPN almost always uses PPTP. You can not connect with OpenVPN. You have to use a PPTP client.

The Ubuntu package is pptp-linux.There is a detailed explanation on how to configure it here.

In a nutshell (I assume you have no GUI on a server),you can create a tunnel with :

pptpsetup --create my_tunnel --server <server_address> --username <username> --password '<password>' --encrypt

Configuration files will be created in /etc/ppp. You can then connect (in debug mode) with:

pon my_tunnel debug dump logfd 2 nodetach

or simply (once it work) :

pon my_tunnel

and stop it with :

poff my_tunnel

If the server is a gateway, you may need to add a route, something like :

ip route add 192.168.1.0/24 dev ppp0


You may want Network Manager with a plugin network-manager-pptp, also see this wikihttps://help.ubuntu.com/community/VPNClient#PPTP