I had an extra raspberry pi b+ laying around and wanted something to do. I had been researching security projects like creating a honeypot when I came across PiVPN, which is built using OpenVPN, and creates an encrypted tunnel to your network. Alternatively, you can set it up on an Amazon web server or a VPS to have an offsite VPN. I set one up to use my home network so I could access SMB shares and the internet.
Here is a link to the project: http://www.pivpn.io/
The process is really simple! All you have to do is setup raspbian on a raspberry pi and run this command:
curl -L https://install.pivpn.io | bash
From there an installer runs and you just make your way through the prompts. I did reference a couple of guides through the process to help me understand the options. A link to those walkthroughs below.
Note: Generating an encryption key really does take a while. For me 1 hour + to complete. I was worried it got locked up for a bit after around 45 minutes.
A couple of things worth mentioning: Do not forget to open UDP port 1194 (by default) on your router. Also, if you are interested in accessing network resources such as SMB on a Windows computer you will need to open the ports on Windows Firewall to make that possible. I had to use the below article to figure out how to open Windows firewall to other subnets:
Once the installation process is complete it is time to create client keys. This is done easily by typing:
You are once again led through a quick form where you type in the name of the client and the password. This creates an .opvn file that can be transferred to the client to allow access to the VPN. I used FTP to transfer the file to my computers.
The last step, which wasn’t as clear to me from the articles was how to allow a client to connect. The best way to do it that I have found is to go to https://openvpn.net/index.php/open-source/downloads.html and check out their clients. It is working pretty well on my Windows 10 laptop. There is also an android app here: https://play.google.com/store/apps/details?id=net.openvpn.openvpn&hl=en. Which is also working great on my android devices.
I have been testing this project for the last day now and really like it. I haven’t run into any issues so far. I really like this project and it really has made running your VPN much less difficult than it ever was. The process was a breeze and I am happy with the results.
Update 1/4/17: I uploaded this on Reddit and got a response from a user that I thought would be useful for some. hammertonail says “One thing I would note, OpenVPN is very sensitive to local time. So be sure to set you localization settings correctly before you start the install!”. Thanks for the tip!
Update 12/20/17: I previously had a PiHole on another raspberry pi on my network but wanted to install PiHole along side PiVPN. I also believe someone in the comments asked me about this. I was able to successfully get this working using a blog that I found here: https://marcstan.net/blog/2017/06/25/PiVPN-and-Pi-hole/.