Julwrites Stuff

Setting up PiVPN and PiHole


Setting up PiVPN and PiHole

Pi Networking

I’ve been using PiHole for awhile, and in a few configurations. At one point it was my DHCP server, and that worked quite well especially when I wasn’t keen on using my ISP’s router settings and wanted more control.

PiVPN

But since I set up Homeassistant recently, I’ve been wondering about a way to access my home network remotely, so that I could still check on home without needing something like Google Home. A little googling and I found PiVPN, which looked perfect.

It promised VPN connections on both OpenVPN and Wireguard (I was happy with just Wireguard), and it was able to run alongside PiHole. In fact, it is actually one of their features.

As an added bonus, this could be installed alongside PiHole, which meant I didn’t have to re-flash my PiHole (which I would have to do if I chose to use OpenWRT instead)

The downside though? There was no Web UI. But honestly, that’s probably fine. I asked myself: How many clients do I want to connect and how often? And the answer was probably just the one or two personal devices.

Setting up PiVPN

Now came the fun part. I obviously didn’t want to just bind the public address of my home network for access through Wireguard, so I needed to set up some other method that would at least make that IP address hidden from any client point of view.

Enter Dynamic DNS! PiVPN had some guides for Dynamic DNS setup, which led me to Duck DNS Dynamic DNS setup. The steps themselves were fairly straightforward, and I was able to adapt them to Namecheap , which is the DNS provider that I use. They similarly had a guide on how to dynamically update the host IP

Once that was set up, I was good to go! I just ran the commands for adding clients and generating the necessary QR Codes or config files, and got the individual clients set up.

PiVPN Add

Now I can access my Homeassistant configuration remotely through the Wireguard tunnel!

The final blow

Wifiman

Turns out, I was actually able to tunnel into my network using WifiMan , since I am using a Ubiquiti router. So maybe this whole project was a little moot, but no harm having an open source option, right?