Jump to content

How to Setup A OpenVPN Server On Google Cloud

i want to setup a openvpn server on google cloud but cannot figure it out. any help would be appreciated.

Link to comment
Share on other sites

Link to post
Share on other sites

Well you have plenty of options : 

  • You could either choose to run a Virtual Machine Instance on the Google Cloud Platform (GCP) :
    • From there you could choose to go with the public image with your distro of choice (https://cloud.google.com/compute/docs/images#os-compute-support) and install the appropriate open-vpn package (You'll find great tutorials if you google the name of your distro + open vpn)
    • You could also choose to, for example go with a custom Image and run pfSense on your VM. pfSense is a distribution that can be used as a firewall, that is based on FreeBSD (for a solid foundation), and comes bundled with several options for running VPN servers, and a nice Web GUI, but is, IMHO a little overkill for your project.
  • Or you could try and find an appropriate container image, containing an installation of open-vpn server, and running it as a container on GCP. 

Whatever you decide, please first read on and make some research about these two options (a google search with "running a vm on gcp", "install open-vpn server on debian" will go a long way), and ask us question! We'll be happy to help!

 

PS: You could also choose to use a VPN service, which will require almost no setup, or another Cloud Provider. In any case, best of luck in your project! 

Link to comment
Share on other sites

Link to post
Share on other sites

23 minutes ago, Camille Terol said:

Well you have plenty of options : 

  • You could either choose to run a Virtual Machine Instance on the Google Cloud Platform (GCP) :
    • From there you could choose to go with the public image with your distro of choice (https://cloud.google.com/compute/docs/images#os-compute-support) and install the appropriate open-vpn package (You'll find great tutorials if you google the name of your distro + open vpn)
    • You could also choose to, for example go with a custom Image and run pfSense on your VM. pfSense is a distribution that can be used as a firewall, that is based on FreeBSD (for a solid foundation), and comes bundled with several options for running VPN servers, and a nice Web GUI, but is, IMHO a little overkill for your project.
  • Or you could try and find an appropriate container image, containing an installation of open-vpn server, and running it as a container on GCP. 

Whatever you decide, please first read on and make some research about these two options (a google search with "running a vm on gcp", "install open-vpn server on debian" will go a long way), and ask us question! We'll be happy to help!

 

PS: You could also choose to use a VPN service, which will require almost no setup, or another Cloud Provider. In any case, best of luck in your project! 

i just cant figure it out woth the ports and the udp tcp and the nat the vm are behind how could i configure it.

Link to comment
Share on other sites

Link to post
Share on other sites

I use this script OpenVPN Script on my vm for easier OpenVPN setup which works on OpenVZ, KVM & Xen based VMs flawlessly. I've been using that for a few years. Not sure if that will work on Google Cloud.

Link to comment
Share on other sites

Link to post
Share on other sites

10 hours ago, Turtleinahafshel said:

i just cant figure it out woth the ports and the udp tcp and the nat the vm are behind how could i configure it.

Usually, on a VM like the one provided by Google, you get an external IP address, which means that you won't need to configure port forwarding and NAT in order to access to your OpenVPN server.

 

The script that razibhasan mentioned looks good. Maybe you can install a VM with CentOS or Debian, and use this script to setup your VPN server on it.

Link to comment
Share on other sites

Link to post
Share on other sites

8 hours ago, Camille Terol said:

Usually, on a VM like the one provided by Google, you get an external IP address, which means that you won't need to configure port forwarding and NAT in order to access to your OpenVPN server.

 

The script that razibhasan mentioned looks good. Maybe you can install a VM with CentOS or Debian, and use this script to setup your VPN server on it.

but the vms have a internal and a external and i cant figure out how to configure the connection settings.

Link to comment
Share on other sites

Link to post
Share on other sites

Can you post a screenshot of what you're seeing? Maybe I could help.

Link to comment
Share on other sites

Link to post
Share on other sites

4 hours ago, Camille Terol said:

Can you post a screenshot of what you're seeing? Maybe I could help.

i get a error could not connect but if says the connection is reachable and i cant ping the external ip. i just dont know what to do with the internal

Link to comment
Share on other sites

Link to post
Share on other sites

Well, you don't really need the internal. What you're trying to achieve is having an OpenVPN server that listens on the external interface, and that gives you access to Internet thourg the same interface. The internal interface is probably in case you want to interconnect several VMs on Google Cloud.

Link to comment
Share on other sites

Link to post
Share on other sites

On 8/7/2017 at 6:53 AM, Camille Terol said:

Well, you don't really need the internal. What you're trying to achieve is having an OpenVPN server that listens on the external interface, and that gives you access to Internet thourg the same interface. The internal interface is probably in case you want to interconnect several VMs on Google Cloud.

how could i disable it

Link to comment
Share on other sites

Link to post
Share on other sites

9 hours ago, Turtleinahafshel said:

how could i disable it

You actually don't need to. Just make sure your OpenVPN server listens on the external interface.

Link to comment
Share on other sites

Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

×