In this tutorial, you will learn how to crate your own free VPN server with free Open VPN, Dropbear SSH client, S tunnel and Squid Proxy. This VPN server created using free VPS provided by Google Cloud Platform free tier, but it works with any VPS server provider. You can use this for TLS tunnel and HTTP injector apps to get secure internet connection. This is a Google Cloud VPN server that use a secure tunnel. You will never face security issues like in free VPN. Let’s go to the process. Don’t miss anything stay until end.
Port OpenSSH 22,444
Port Dropbear 80,143
Port SSL 443
Port Squid 8000,8080 (limit to IP SSH)
Port UDPGW 7200
badvpn : badvpn-udpgw port 7200
OpenVPN : TCP 1194 & UDP 25000
Nginx : 81
menu : displays a list of available commands
usernew : create new SSH account
trial : create a trial account
hapus : delete SSH account
cek : check user login
member : check SSH members
reboot : reboot VPS
speedtest : speed test VPS
info : display system information
about : information about auto install script
Webmin : http://ExternalIP:10000/
Config Free OpenVPN TCP : http://ExternalIP/client-tcp.ovpn
Config Free OpenVPN UDP : http://ExternalIP/client-udp.ovpn
VPS AUTO REBOOT EVERY 12 HOURS 12 NIGHTS.
RUN INTO COMMANDS AFTER COMPLETE SCRIPT INSTALLATION.
Setup Google Cloud VM Instance
First, sign up to Google Cloud Platform using your Google account. In the dashboard, under “compute engine” click “VM instance”. Then click “create” button to setup new virtual machine.
Enter name of the VM instance what ever you like. Chose a region and zone that include in google cloud platform free tier. Then select machine type f1 micro under N1 series. Click “change” button to select a boot disk. You have to select Ubuntu 18.04 LTS as the OS and the version. Leave other settings default and click “select” button. Under firewall, tick mark both allow HTTP and HTTPS traffic. After finishing the setup, click “create” button to deploy the VPS.
Setup VPC Network
You have to get a static IP address for the instance. In the main menu, select “external IP address” under “VPC network”. Change the IP type to “Static”. The Static IP address is not change during restart the server.
Now, you have to set a firewall rule to allows VPN server ports. In the VM instances page, click “setup firewall rule” at the bottom of the page. Then, click “crate firewall rule” button at the top of the page. Enter a name for the rule and change the target to “all instance in the network”. If you want you can choose a specific target. Enter this source IP range to allow all ranges of IP addresses.
IP Range: 0.0.0.0/0
Under protocols and ports, select allow all to open all port of the VPS. After all, click “create” button at the bottom. Now, VPS setup is over. Let’s see how to create a VPN server.
Setup Free VPN Server
Click “SSH” button of the VM instance to get terminal window. To get root access, enter the command.
You have to add a user to the server. Use the following command and don’t forget to Replace the user name. Here, enters a password to user and verify it by retyping. You can fill this detail or skip by pressing “enter” button.
sudo adduser username
Now, give root access to new user using this command. Replace username that you entered.
usermod -aG sudo username
Use exit command to log out in root user.
Log in to the new user, entering the password.
Use this command to get root access and enter the user password.
Now, we finished the adding a new user and gave the root access. Download the VPN server script using this command.
Use this line for make sure the script is executable.
chmod +x ubi18.sh
Now execute the script using this command. This takes some time to get ready your server. Please be peasant.
Ok, now VPN server is ready. You can see the details of the server here. Just copy and keep the all the details here in safe place.
Following are the features of this script:
- OpenSSH, ports: 22, 444
- Dropbear, ports: 80, 143
- SSL, port: 443
- Squid3, port: 8000, 8080 (limit to IP VPS)
- Badvpn: badvpn-udpgw port 7200
- OpenVPN: TCP 1194 and UDP 25000
- Menu script: displays a list of available commands
- Usernew script: create SSH and OpenVPN accounts
- Trial script: create SSH and OpenVPN trial accounts
- Delete script: delete SSH and OpenVPN accounts
- Check script: check user login
- Script member: check the list of SSH and OpenVPN members
- Script speedtest: VPS speedtest
- Info script: displays system information
- Script about: information about the auto install script
- VPS auto reboots every 12 at night
Add a New VPN User
Before adding a user, reboot the VPN server using this command. It may cause to disconnection of the terminal window for a few moments. Try to connect it again.
After re connection, get root access to add a new VPN user.
You can type “menu” to get all VPN server commands.
Use new user command and add the asking credentials. You have to enter user name, password and expiration time of the account. Then, copy the all details of the user.
Now, all set at the server side. Let’s see how to configure client side.
Connect to HTTP Injector
I try to connect it using HTTP injector a popular app. If the app is not in your mobile, use Google Play Store to install it. Open the app and change the tunnel type to TLS SSL Stunnel. In the main menu, select SSH settings. Try to fill all the details here using your server information. enter external IP address as SSH host name and SSH port as 443. Enter your relevant VPN username and password that we entered in previous step. Untick enable proxy port.
If you want you can use Custom SNI but it is not necessary. After finishing the setup, click “start” button. You can see here it successfully connected to your own server. Let’s check the IP address to verify it.
You can see the server IP address and internet service provider. It’s Google Cloud Platform. No worry anymore about your data security. You are totally safe here.
Webmin Admin Access
You can access your VPN server using Webmin IP address that was given by the server information. login in using administrator user we initially created.