Connect with us

Hi, what are you looking for?

Internet

How to use a Raspberry Pi as a VPN server

How to use a Raspberry Pi as a VPN server

-πŸ–₯️-

In 2019, is there anything the $35 Raspberry Pi cannot do? It seems that there is no. Recent Raspberry Pi projects include a functional smartphone, a computer vision kit, and even a movie projector for a more traditional home theater experience.

Raspberry Pi (RPi) can be turned into a virtual private network (VPN) server. Among the many things you can fix in RPi are data connections; This is one reason why they are often called “pirate Swiss army knives” – not necessarily of the malicious kind.

RPis can act as servers for many projects, and if you have more than one personal computing device on a personal network, RPi can run as a dedicated server. From Minecraft servers to website hosts to IRCs to network prints, many of these projects involve a series of software installation and configuration steps, as is the case for the RPi VPN server you’ll build in this tutorial.

Why would you want a Raspberry Pi VPN server?

The main reason to run your own open source VPN server from RPi is overall security, which no one can take for granted. If you access a web page over an open Internet connection β€” a connection that was not established with a proxy or VPN tunnel β€” the website administrator could potentially get your IP address and locate you when you connect.

Furthermore, your ISP will have a history of your browsing session, and you cannot be sure that the man-in-the-middle attack did not capture the information exchanged by your computer and the web hosting server.

If you are browsing inside an oppressive system that monitors and monitors internet activity, the fact that you are reading content related to setting up VPN servers may attract the attention of unpleasant individuals such as intelligence agents.

The most amazing reason to do the RPi VPN server project is because it’s fun. The Raspberry Pi Foundation wants you to tinker with the hardware and talk to people about your RPi projects to expand computer literacy. This project is great for fun and function.

Create a double hop connection

While you can use RPi as your only VPN protection, keep in mind that the operating word here is “lightweight”. As in “An RPi server costs less than $40 and is the size of a credit card”. So, I suggest you include a physical VPN server in addition to the RPi VPN server that you will create in this project. To use a bit of technical jargon, you will have a double connection, which means poor security.

There are hundreds of VPN apps for consumers today; Find a protocol that supports the OpenVPN protocol, which is newer than most other VPN connection protocols such as PPTP and L2TP, and is the current gold standard in secure connection. Some examples would be Private Internet Access, ExpressVPN, or the OpenVPN app itself, all three of which allow their users to connect using the open source OpenVPN protocol. Here is a guide to setting up Express on an RPi server, which makes the process fairly simple.

The most important factors for choosing a VPN are privacy, price, and speed. Find a provider that operates servers in many countries and a solution that will maintain good speed even when connected to an RPi server.

With that out of the way, it’s time to get serious about using a Raspberry Pi to build a VPN server from scratch.

start

As with everything about RPi, the first step is to make sure your machine is running the correct Linux distribution. In this case, this would be Raspbian, preferably a version that is at least Jessie or Stretch. As you can tell from its name, Raspbian is a Debian-based operating system, and as such it is part of the Linux family often considered a universal operating system platform.

Ideally, you have a wired Ethernet connection between your RPi and your router; Otherwise, you will have to make sure to use a file wlan0 . network argument instead of eth0 When configuring the server.

You want to go into SSH server mode for this project, which you can enable through the Pi menu under Communication options. If you are a terminal user, you can enter:

sudo raspi-config

In either case, SSH will not be enabled until you restart the RPi. The next step is to install PiVPN, which you can get from GitHub. But you really want to skip the browser session because you are already in SSH, so bring up the terminal and enter:

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

When prompted for updates and dependencies, accept all of them and wait for the installation process, which may take some time. You will be introduced to the PiVPN installer, which is nicely presented in a graphical interface.

Let the installer script set up a logical static IP address unless you already have a preferred one in mind. Here’s where you have to choose between wlan0 or eth0β€”the latter is for a wired connection to your router while the former is for WiFi. If you allow the PiVPN installer to enter preset values ​​for your static IP address, they will be the same as your router’s values.

After a few minutes of calibration and configuration (which you can see happening in the device), the PiVPN interface will prompt you to choose a local user; Your username will be pi, you can check this link to add other users later. For this purpose, you can always use the terminal after installation by entering the pivpn command and reviewing the options, for example:

pivpn -new user nopass

This command will create a profile username for “newadditionaluser” without a password.

Important: Enable unattended upgrades

The next step is important to open the data communications port on your RPi. The screen will prompt you to enable unattended upgrades, which you will want to confirm Yes. Don’t risk getting updates rejected when you have an open port; If you do, you will be found by malicious hackers performing port scans.

After this step, you will see the device turned on before you get to the OpenVPN dialog menu. PiVPN won’t work without this package, so it will remind you to install and specify the port number to run – ie the port you opened and secured with unattended upgrades in the previous step.

Since you will be running your own VPN server, you can choose the strength of your data encryption; The recommended level is 2,048. The following screens will generate a security certificate based on your regional and hardware settings; There is no need to change it. Generating your keys will take some time, especially if you choose 4096-bit encryption; Your RPi may run hotter with this powerful encryption, but it won’t melt.

Choose a domain name server; Google is a good option. Restart when prompted.

Set up a PiVPN client

Once back from the restart, open Terminal and type:

add pivpn

You will be asked to name the client and create a password. From now on, your VPN connections will pass through this server, adding a layer of security to your browsing, apps, VoIP, and gaming sessions.

In today’s world, no one should be making fun of more security. Plus, as I mentioned, playing with a Raspberry Pi is just plain fun.

[ad_1]
Don’t forget to share this post with friends !

Click to comment

Leave a Reply

Your email address will not be published. Required fields are marked *

Related

Internet

AnyConnect certificate-based authentication. Cisco community πŸ‘¨β€πŸ’» The information in this document is based on the following software and hardware versions: ASA 5510 running software...

Internet

AnyConnect: Install a self-signed certificate as a trusted source πŸ‘¨β€πŸ’» kmgmt-2879-cbs-220-config-security-port objective The goal of this article is to walk you through creating and...

Internet

ITProPortal . Portal πŸ‘¨β€πŸ’» We live in a dynamic moment in terms of technology. Even criminals are becoming more technically savvy and are using...

Internet

Top 5 Free AV Packages – πŸ‘Œ Bitdefender Antivirus Free Edition best interface Positives Works on Windows 7 and 8.1 Very easy to use...