Awesome Open Source
Awesome Open Source

VPN Access Point Setup

This script was developed on a fresh install of Raspbian on a Raspberry Pi 2B. When run on a fresh installation of Raspbian, it creates all the necessary files needed to start a VPN tunnel on boot, create a hotspot, and forward AP client traffic through the VPN

Verified Working Platforms

  • Raspberry Pi 2B

    • [X] Raspbian
  • Raspberry Pi 3

    • [X] Raspbian

Verified Working Wireless Adapters

  • [X] Alfa AWUS036NEH


A word about DNS leakage: Always check for DNS leakage after connecting to the Pi. I can't account for client/router settings to which the Pi will be connecting.

This setup assumes that the VPN client app is Openvpn, using *.ovpn files from Private Internet Access. You must have an active PIA account and configure the script with your credentials

  1. Create a file called ssh on the boot partition of the Pi's SD card from your laptop. Place it in the Pi. Sometime in 2016, SSH was switched off by default on Raspbian unless this file exists.

  2. Boot your Pi with Ethernet and WiFi adapter plugged in. Make sure your computer is on the same network.

  3. SSH in to the Pi. I used nmap --open -p 22 to find the IP.

    # default password is raspberry
    ssh -l pi

    sudo passwd pi
  5. Become root

    sudo su
    cd /root
  6. Download the setup script and run it as root. (Walkthrough of the script at the end of the post)

    # download
    # read and configure it
    # run it
  7. Reboot

If everything went well, when the Pi boots back up, there should be a new WiFi network in the area. Log into it and visit You should see green text near the top that says you're protected.

Related Awesome Lists
Top Programming Languages
Top Projects

Get A Weekly Email With Trending Projects For These Topics
No Spam. Unsubscribe easily at any time.
Shell (173,234
Script (62,611
Raspberry Pi (22,364
Vpn (3,899