Come attivare una VPN sul Raspberry Pi

Logo di Feddit Logo di Flarum Logo di Signal Logo di WhatsApp Logo di Telegram Logo di Matrix Logo di XMPP Logo di Discord

How to activate a VPN on the Raspberry Pi

Warning: This post was created 1 year does

Difficulty: ◉◉◉◉

This is a text automatically translated from Italian. If you appreciate our work and if you like reading it in your language, consider a donation to allow us to continue doing it and improving it.

After the guide a few weeks ago on the use of Joplin with Nextcloud, we continue to produce guides with different difficulties: in this case we believe that the article how to activate a VPN on the Raspberry Pi both to maximum difficulty (for the articles we want to delve into on Le Alternative) and it is also the first of this series!

There are various reasons why you may need to activate a VPN at home: for example, you may need to connect to your home network to be able to use the IP with which you go out. Some providers, such as Fastweb, allow you to have a public and static IP address for free even if it is not reported anywhere: just contact Fastweb support (via email, Twitter or by telephone) and you can obtain it without any additional cost.

An alternative to the fixed IP is to use the DDNS (not to be confused with i simple DNS) but in this guide we will not address this part so as not to complicate things further.

How to activate a VPN on the Raspberry Pi: PiVPN

First of all, therefore, you must have any model at home Raspberry Pi.

Thanks to an amazing software called PiVPN you can in fact install it on yours Raspberry Pi a VPN of your choice OpenVPN And WireGuard.

Installation

For install PiVPN on your Raspberry just use the command:

curl -L https://install.pivpn.io | bash

After installing it you will be asked for some configuration information which you can do independently based on your needs. When you have no other options, always press OK: It will ask you if the IP addresses and gateway are correct. If they are, press YES.

You will be asked to enter a user, you can choose the default one but you are not obliged and it is always good to use different and unique users.

As port, choose UDP and leave the default port number. If you decide to change the port, remember that it will also have to be opened on the router.

If you have a static IP select the IP, alternatively tell it that you want to use DDNS.

That's it: you've already finished installing PiVPN. Now you need to set up a user to access the VPN.

Configuration

Again from the command line, write:

pivpn add

You will also be asked to enter a password which will be encrypted.

After this operation it will have generated a file called .ovpn inside /home/pi/ovpns/my-vpn-client.ovpn. This is your configuration file. All you have to do is import it onto your smartphone or any other client OpenVPN and connect when you need it!

Once connected you will use the same home IP.


We hope you enjoyed this guide: we are trying to produce simple guides suitable for anyone. Even when we talk about "high" difficulty we try not to use overly complicated terms and simplify the operations to be carried out as much as possible.

If you have anything to report to us you can find us on Codeberg!

Join communities

Logo di Feddit Logo di Flarum Logo di Signal Logo di WhatsApp Logo di Telegram Logo di Matrix Logo di XMPP Logo di Discord




If you have found errors in the article you can report them by clicking here, Thank you!

By skariko

Author and administrator of the web project The Alternatives