Browse the internet privately or access your home files from anywhere with this Raspberry Pi Tutorial.
October 5th, 2022
raspberry pi
A VPN acts as an encrypted middleman for your internet traffic. Rather than going directy from your computer to the internet service provider to the desired website, you instead go computer to the ISP to the VPN, back to the ISP, and then to the desired website. This allows you to access files remotely or disguise and secure your internet traffic.
If you haven't set up your Raspberry Pi yet, you can follow my tutorial for that here.
Open a terminal to your Pi. You can do this with SSH or directly on your Pi as a desktop. First, let's update your pi with the following code:
sudo apt update
sudo apt upgrade
Run the following command to download PiVPN
curl -L https://install.pivpn.io | bash
Continue through the prompts until you see DHCP Reservation
.
This step varies for everyone depending on your router. So if you're not sure how to do the following two things, I suggest Google.
49152-65535
pivpn add
phone
pivpn -qr
to generate a QR code.In you Pi, type:
sudo nano /etc/sysctl.conf
This will open a file. Uncomment the following lines:
net.ipv4.ip_forward=1
net.ipv6.conf.all.forwarding=1
Press Ctrl+S
to save and Ctrl+X
Next we need to let our router know what we're doing. This process is specific to your router so please Google - "port forwarding for my ______ router"
Create a custom service. I call mine VPN
. Then you will have options for TCP
or UDP
protocols. Use the UDP
protocol.
Open the WireGuard app on your phone and turn on you VPN. You are now tunneling through your Raspberry Pi! If you have any questions feel free to leave a comment on the YouTube video I linked above. I try to read every comment.