In this segment we are going to "Install PiVPN on RaspberryPi inside DietPi"
What is DietPi ?
DietPi is extremely lightweight operating system, start at 400MB in size (3x lighter than 'Raspbian Lite'). With features of low process/memory footprint and DietPi-RAMlog installed by default, DietPi allows you to get the maximum performance from your device.
Equipment Required :
Raspberry Pi 3 Model B +
Micro SD Card "Minimum 4 GB"
Ethernet Cord for LAN Connection
External Hard Drive or USB Drive
Raspberry Pi Case
What is PiVPN Server ?
PiVPN (Virtual Private Network) is one of a few different ways you can access a raspberry pi remote computer. By using PiVPN we can easyly create our own VPN server and that will help us in absolute easiest way to install and run your own VPN.
> Package Required to Install
- PiVPN - OpenVPN installer & management tool
- First of all we need of open Wireless Network Watcher to access the IP Address of our Raspberry Pi.
- Then we need to open SSH console Putty, and type the IP Address to connect the DietPi CLI.
- After we logged in to DietPi, then you need to type a command to access the dietpi-software.
- Now, navigate to Software Optimized and select PiVPN by using the Spacebar and press OK.
- Setup Static IP and note down the IP Address
- Select User Name
- Enable the Unattended Upgrades
- Select UDP protocol, Bevideo it is Faster then TCP
- Now, Select the Port Number. 1194 is the Default Port you can type any other port that you want.
- Select the Default Level of Encryption
if you select a higher level of Encryption, the key will be strong but take more time to create.
- Now, Select your Public IP Address If yopu have a static IP Address then Choose first option.
Otherwise we need to setup a Dynamic DNS.
- Now, we need to select DNS Provider. You can select the Default Option.
> Setting up Port Forwarding on Router
- To forward the port on the router, we need to know the IP Address of our router.
- To check the router IP Address use Wireless Network Watcher and it will display the router IP Address.
- Type this IP Address in your browser and it will open the login page for your router.
- Now, you need to enter the username and password and login to your router.
- If you don't know the username and password of your router you can always ask your ISP.
- For personal routers you can always check online for default username and password for the router.
> Setting up Dynamic DNS
- First of all we need to visit DUCKDNS website to create a Free Dynamic DNS for our Public IP.
- You can use any of the above method to login to DUCKDNS website and create a subdomain for your website.
- Once you logged in then you can create a subdomain for your Public IP Address.
- That you can used to visit OMV from Internet.
For example in my case i have created omvpcmac as my subdomain, So, i can access it as omvpcmac.duckdns.org.
You can create 5 subdomains on Duck DNS account for free.
> Add Clients to VPN Server
- Command : pivpn add
- Type the User Name and then Password 2 Times.
> Download Client File
- Location : home/dietpi/opvns
- Tools use to Download Client File
> Configure OpenVPN Client
- You can directly download OpenVPN software from the download link.
- After the download finish you can install the software as shown in the video.
- Once, the installation finsh you need to open the software by right click on it and choose "Run as Administrator"
- Default Path to save the .ovpn file or we can say configuration files : C:\Program Files\OpenVPN\config
- Now, you can save your downloaded configuration files to config folder and then it will appear in VPN Client.
- Then we can select the configuration file by clicking on it and enter the password to connect to it.
- If the password is correct you can easily connect to the server and the OpenVPN icon changed its color to green.
> Download & Setup VPN Software for Android
- Open PLAYSTORE in you Android Device and look for OpenVPN for Android.
- If the app is already installed in your device it will ask you to open the app.
- Otherwise it will give you an option to install the app.
- Once the "OpenVPN for Android" app is installed then use the downloaded config file to connect to VPN server.
Note : The default file extension of configuration file is .ovpn.
Enjoy using it and share your thoughts.