PiVPN - What a great little tool

I had a spare pi lying around and experimented with PiVPN.

https://pivpn.io

You run the script and it makes it dead simple to set up either a Wiregard or OpenVPN server on a Raspberry Pi. Once the setup was complete, I installed the Wiregard app on my cell phone, imported the profile PiVPN generated for me and I was up and running.

Now I have my phone set up it automatically VPN into my house whenever it’s not on my home WiFi. When I’m on cellular data, I am VPNed into home. When I am on work WiFI, I am VPNed into home.

Now I can ssh into servers in my house and fix the Plex server when my wife calls to tell me there is a problem. And I can stream music from my house to my phone without needing to forward a port.

Very happy with this setup.

I have a VERY OLD PC running as a Linux server in my house. I’m slowly replacing the services running on it with 4 GB Raspberry Pis.

without needing to forward a port.

Don’t you still need to forward a port for the vpn itself? Or does it work without somehow?

Does anyone know if you can combine this with Pihole so that you can get the benefit of ad blocking while you are away from your home network?

How do you handle having a new IP address every couple days by your ISP?

I have Starlink and behind CGNAT, so I haven’t explored this yet.

Nice! do you reckon I can run Pi VPN on the same pi i use for my pihole ? It’s a pi 3 B+

VPN usually has a bit of a performance problem. I’m currently using ZeroTier that provides a secure virtual lan connection to all your devices. A few minutes to setup and bango - you can talk to home systems as though your’e there. Client apps available for most popular platforms. Free for personal use. https://my.zerotier.com/

It is extremely useful when your work Wi-Fi blocks social media and messaging apps. But the speed is disappointing. I ran speed tests on my RPi 3B+ using OpenVPN and then switched it to WireGuard on a 100mbps (edit: up and down) Internet connection. I get that there is overhead to it all. I was getting about 10mbps with OpenVPN, and 11mbps with WireGuard. That hurts.

I use no-ip.com for my Dynamic DNS. It’s free if you don’t mind having to click through a reminder email every month.

I run a script on the RPI that automatically updates CPanel https://www.i-s-a-c.ro/wp/?page_id=39

wireguard installation is dead-simple already

Cool. Though I’m going to have to do some research, this is such a neat idea.

I should have been more clear.

Yes, I need to port forward from my router to the Pi running PiVPN. But that’s all I need to port forward. I don’t need to port forward any other devices on my network any more.

My previous exposure was http to my ubuntu-server, https to my ubuntu-server, whatever ports Plex forwards via uPNP, and my Home Assistant box. So, I had 4 things exposed. Now, I just have one thing exposed: the PiVPN.

I was working on getting everything behind a reverse proxy, but this is less work.

Pihole website has a guide how to combine it with wireguard.

You can. That’s how I am using it. You just setup your PiHole as the DNS server in your VPN config.

One easy solution I can propose is to set your DNS on Router level. So every device basically contacts your router for DNS resolving by default and your router forwards it to your Pihole device. Works flawlessly for me.

The only real drawback is that you can’t monitor individual device requests in PiHole as all requests look as they come from the router.

This in consequence also works with devices that are connected to your home network through VPN.

I use Dynamic DNS and set everything up by DNS name. I’m paying for EasyDNS, which costs $20 a year for my plan. But my router also offers dynamic DNS for free through Netgear.

I use http://www.noip.com - it’s free as long as I confirm monthly the opened account.

I use noip.com but I am not sure I need it. My IP address hasnt changed in years. I got it thinking all residential IPs change but apparently that isnt the case

The script installed Wiregard for me without issue.

I don’t see why not. I believe the 3B+ is limited to 100 MB Ethernet. if it’s just for you, that should be fine.

Zerotier adds a third party into the equation when trying to connect to my house. I would prefer not to do that.