# Raspberry pi as a vpn router

**URL:** https://dietpi.com/forum/t/raspberry-pi-as-a-vpn-router/2119
**Category:** Troubleshooting
**Created:** [1 April 2018 16:45 UTC](https://dietpi.com/forum/t/raspberry-pi-as-a-vpn-router/2119 "2018-04-01T16:45:35Z")
**Posts on this page:** 16
**Page:** 1

<div class="post-metadata">

### Author: ![Apoc](https://dietpi.com/forum/letter_avatar_proxy/v4/letter/a/5f8ce5/32.png) [@Apoc](https://dietpi.com/forum/u/Apoc)
#### Post date: [1 April 2018 16:45 UTC](https://dietpi.com/forum/t/raspberry-pi-as-a-vpn-router/2119/1 "2018-04-01T16:45:35Z")

</div>

I’d like to use my Rpi3 as a vpn router. I have my vpn server in another rpi in another country and I’d like to use my rpi to connect to it through the ethernet and create an access point so I can connect my tv to it and use it to watch Netflix.

Is there any good tutorial? Thanks.

---

<div class="post-metadata">

### Author: ![WarHawk](https://dietpi.com/forum/user_avatar/dietpi.com/warhawk/32/21_2.png) [@WarHawk](https://dietpi.com/forum/u/WarHawk)
#### Post date: [2 April 2018 04:41 UTC](https://dietpi.com/forum/t/raspberry-pi-as-a-vpn-router/2119/2 "2018-04-02T04:41:27Z")

</div>

It built in…or you can go to [PiVPN](http://www.pivpn.io/)  
however the script in dietpi should work without the workaround

---

<div class="post-metadata">

### Author: ![Apoc](https://dietpi.com/forum/letter_avatar_proxy/v4/letter/a/5f8ce5/32.png) [@Apoc](https://dietpi.com/forum/u/Apoc)
#### Post date: [2 April 2018 06:15 UTC](https://dietpi.com/forum/t/raspberry-pi-as-a-vpn-router/2119/3 "2018-04-02T06:15:14Z")

</div>

> [@WarHawk](#):
>
> It built in…or you can go to [PiVPN](http://www.pivpn.io/)  
> however the script in dietpi should work without the workaround

I don’t need a server. I need a client that can also act as a hotspot.

---

<div class="post-metadata">

### Author: ![Apoc](https://dietpi.com/forum/letter_avatar_proxy/v4/letter/a/5f8ce5/32.png) [@Apoc](https://dietpi.com/forum/u/Apoc)
#### Post date: [5 April 2018 09:57 UTC](https://dietpi.com/forum/t/raspberry-pi-as-a-vpn-router/2119/4 "2018-04-05T09:57:59Z")

</div>

So…anyone?

---

<div class="post-metadata">

### Author: ![Abhik87](https://dietpi.com/forum/letter_avatar_proxy/v4/letter/a/aca169/32.png) [@Abhik87](https://dietpi.com/forum/u/Abhik87)
#### Post date: [2 May 2018 22:08 UTC](https://dietpi.com/forum/t/raspberry-pi-as-a-vpn-router/2119/5 "2018-05-02T22:08:23Z")

</div>

Yes, RPi3 as a WiFi router is possible - I’ve had success with this myself:

[https://gist.github.com/superjamie/ac55b6d2c080582a3e64](https://gist.github.com/superjamie/ac55b6d2c080582a3e64)

Check out the comments on Github if you have any difficulties. And as you probably know you should use a VPN for Netflix such as [Sneakflix](https://www.sneakflix.com/) but I understand that you are hosting the VPN server itself on another RPi?

---

<div class="post-metadata">

### Author: ![Apoc](https://dietpi.com/forum/letter_avatar_proxy/v4/letter/a/5f8ce5/32.png) [@Apoc](https://dietpi.com/forum/u/Apoc)
#### Post date: [3 May 2018 07:32 UTC](https://dietpi.com/forum/t/raspberry-pi-as-a-vpn-router/2119/6 "2018-05-03T07:32:36Z")

</div>

> [@](#):
>
> Yes, RPi3 as a WiFi router is possible - I’ve had success with this myself:
> 
> [Raspberry Pi VPN Router · GitHub](https://gist.github.com/superjamie/ac55b6d2c080582a3e64)
> 
> Check out the comments on Github if you have any difficulties. And as you probably know you should use a VPN for Netflix such as [Sneakflix](https://www.sneakflix.com/) but I understand that you are hosting the VPN server itself on another RPi?

Yes, I have another rpi acting as a VPN server at my parents home in my home country.

Thanks for the link, I’ll get to it.

---

<div class="post-metadata">

### Author: ![MichaIng](https://dietpi.com/forum/user_avatar/dietpi.com/michaing/32/7_2.png) [@MichaIng](https://dietpi.com/forum/u/MichaIng)
#### Post date: [6 May 2018 13:23 UTC](https://dietpi.com/forum/t/raspberry-pi-as-a-vpn-router/2119/7 "2018-05-06T13:23:45Z")

</div>

DietPi-Software also contains a WiFi access point solution: [https://dietpi.com/forum/t/dietpi-software-details-for-all-installation-options/22/46](https://dietpi.com/forum/t/dietpi-software-details-for-all-installation-options/22/46)

So overall nice setup:

- One Pi as VPN server at home to have access to local video streaming content.
- A second one as WiFi hotspot with native streaming abilities for abroad 🙂.

---

<div class="post-metadata">

### Author: ![carlevans459](https://dietpi.com/forum/letter_avatar_proxy/v4/letter/c/d2c977/32.png) [@carlevans459](https://dietpi.com/forum/u/carlevans459)
#### Post date: [15 November 2018 14:49 UTC](https://dietpi.com/forum/t/raspberry-pi-as-a-vpn-router/2119/8 "2018-11-15T14:49:06Z")

</div>

I don’t know about Raspberry Pi vs VPN router. I set up a router for connecting to my VPN, therefore slow while connected to VPN. I also run VPN on my phone 24/7. My VPN allows 5 simultaneous connections with [static IP address, so I am well within the limit.

---

<div class="post-metadata">

### Author: ![susanjohn1](https://dietpi.com/forum/letter_avatar_proxy/v4/letter/s/7feea3/32.png) [@susanjohn1](https://dietpi.com/forum/u/susanjohn1)
#### Post date: [29 March 2019 11:27 UTC](https://dietpi.com/forum/t/raspberry-pi-as-a-vpn-router/2119/9 "2019-03-29T11:27:52Z")

</div>

**ADMIN EDIT: Content removed due to unrelated advertising**

---

<div class="post-metadata">

### Author: ![thenewone](https://dietpi.com/forum/letter_avatar_proxy/v4/letter/t/8491ac/32.png) [@thenewone](https://dietpi.com/forum/u/thenewone)
#### Post date: [12 September 2019 10:22 UTC](https://dietpi.com/forum/t/raspberry-pi-as-a-vpn-router/2119/10 "2019-09-12T10:22:48Z")

</div>

Hey, im a new poster here. BUMPING (Im in love with DietPi btw) I wonder when using the RPi3 like a VPN hotspot network settings configured after this guide ,but without piHole and im using DietPis wifi hotspot and openvpn software ( [https://itchy.nl/raspberry-pi-3-with-openvpn-pihole-dnscrypt](https://itchy.nl/raspberry-pi-3-with-openvpn-pihole-dnscrypt) ) then say two different senarians. This is both about security and anonymity thinkings.

**1. What kind of hardenings can be done, is there some security issues/vulnerabilities from outside my network over the internet?** Can someone get some information about the devices?

IF SO how to configure it to be more secure?

**2. What information/logs are saved as default on the device about previous connected devices for example?**  
Are there logs about local ips and/or MAC-adresses that can be exported?  
Example: if the physical device should go into an forensic analysis, what kind of logs and others can be exported?  
Are the device more unsecure if the person are in the radius of the hotspot and can try to connect etc to it? Issues than a normal Router/AP not have?

AND HOW to configure it the best way for less information etc?

---

<div class="post-metadata">

### Author: ![WarHawk](https://dietpi.com/forum/user_avatar/dietpi.com/warhawk/32/21_2.png) [@WarHawk](https://dietpi.com/forum/u/WarHawk)
#### Post date: [13 September 2019 03:37 UTC](https://dietpi.com/forum/t/raspberry-pi-as-a-vpn-router/2119/11 "2019-09-13T03:37:08Z")

</div>

Just found this…maybe it will help

[https://hackaday.io/project/2040-web-security-everywhere](https://hackaday.io/project/2040-web-security-everywhere)

---

<div class="post-metadata">

### Author: ![MichaIng](https://dietpi.com/forum/user_avatar/dietpi.com/michaing/32/7_2.png) [@MichaIng](https://dietpi.com/forum/u/MichaIng)
#### Post date: [13 September 2019 16:33 UTC](https://dietpi.com/forum/t/raspberry-pi-as-a-vpn-router/2119/12 "2019-09-13T16:33:29Z")

</div>

Generally the vulnerabilities are exactly the two software titles that you have installed: The WiFi hotspot and the VPN software.

The hotspot is implemented with hostapd, and supports WPA2 encryption by default. WPA2 is known to have some security leaks meanwhile, but it is still very widely used, e.g. by all common home routers. EAP has better security but requires a much more complicated setup (with host and user certificates and keys, so password is not sufficient to connect), e.g. used for the eduroam network and larger company networks and such.

The VPN is implemented either with OpenVPN or WireGuard. The first is very well known and probed, the second is a very new promising approach that allows much faster transfer rates and higher security etc, but it is new and did not yet reach official stable stage: [https://www.wireguard.com/](https://www.wireguard.com/)  
In both cases, it is essential that you keep and transfer the private keys for server and client safe and secure. In case of OpenVPN this is true for the .ovpn file which contains the private key as well. This must never be readable by anyone else as the client software or to related user. If this is the case, then the software itself can be considered as secure (both, OpenVPN and WireGuard IMO).

Assure that, as long as you only need to connect to the VPN remotely, only the related VPN port is forwarded to the RPi and no other port.

About logging, I am not 100% sure what is logged by default with hostapd, OpenVPN and WireGuard. But all persistent logs (stored on disk) can be found in /var/log. journalctl allows to see all system logs, which includes user authentication and AFAIK some from those software titles as well, but the journal by default is not stored to disk but only hold in RAM. It would be stored to disk automatically, if you create the directory /var/log/journal.

---

<div class="post-metadata">

### Author: ![ghettopi](https://dietpi.com/forum/letter_avatar_proxy/v4/letter/g/9e8a1a/32.png) [@ghettopi](https://dietpi.com/forum/u/ghettopi)
#### Post date: [13 September 2019 22:32 UTC](https://dietpi.com/forum/t/raspberry-pi-as-a-vpn-router/2119/13 "2019-09-13T22:32:50Z")

</div>

All of your questions would:

1. Be better answered in your own thread, not in this one which is a completely different topic
2. Be better answered by an introductory video into computer security or netsec on Youtube

Short answer is:

Anything that you connect to the internet is vulnerable to being breached (hacked).

The only truly secure way to use your Diet-Pi is to keep it off the internet completely, and do not allow the device to be connected via WiFi. That is, make sure it’s not possible for anyone to access it when connected to your network over WiFi (so don’t use WiFi on the network the Diet-Pi is connected to). This means that someone would need physical access to the Diet-Pi to break into it.

Otherwise you should learn about subnets and network zones. You can put some network devices on a zone that’s basically hidden and almost inaccessible from people outside your network.

As for logs. The Diet-Pi logs some basic things mostly for troubleshooting. However, passwords are stored encrpyted except for in the main setup file, but if you were smart you would have changed the defult password from dietpi to something else on the first setup.

---

<div class="post-metadata">

### Author: ![MichaIng](https://dietpi.com/forum/user_avatar/dietpi.com/michaing/32/7_2.png) [@MichaIng](https://dietpi.com/forum/u/MichaIng)
#### Post date: [23 October 2019 16:10 UTC](https://dietpi.com/forum/t/raspberry-pi-as-a-vpn-router/2119/14 "2019-10-23T16:10:21Z")

</div>

See also our general security recommends: [https://github.com/MichaIng/DietPi/wiki/Security-recommendation](https://github.com/MichaIng/DietPi/wiki/Security-recommendation)

---

<div class="post-metadata">

### Author: ![Joulinar](https://dietpi.com/forum/user_avatar/dietpi.com/joulinar/32/57_2.png) [@Joulinar](https://dietpi.com/forum/u/Joulinar)
#### Post date: [6 March 2020 11:55 UTC](https://dietpi.com/forum/t/raspberry-pi-as-a-vpn-router/2119/15 "2020-03-06T11:55:16Z")

</div>

that sound quite complicated to connect first to your Pi and than to the public WiFi. Why not installing VPN Client on your laptop directly and than connect back home to your privat VPN Server?

---

<div class="post-metadata">

### Author: ![trendy](https://dietpi.com/forum/user_avatar/dietpi.com/trendy/32/61_2.png) [@trendy](https://dietpi.com/forum/u/trendy)
#### Post date: [10 March 2020 08:50 UTC](https://dietpi.com/forum/t/raspberry-pi-as-a-vpn-router/2119/16 "2020-03-10T08:50:12Z")

</div>

No need to reply to spambots 🕶
