VPN on Raspberry Pi

VPN

You should consider setting up a VPN on your Raspberry, to have a secure connection to the internet for whatever updates or tasks you do.

There is a lot of VPN providers out there. I suggest to do a search to try to find one that suits your needs (http://lmgtfy.com/?q=secure+vpn+provider – skip the promoted results, or check TorrentFreaks directly).

 

Install OpenVPN

Personally, I have a VPN service provider which enables me to connect using OpenVPN. This can be installed from bash (either click F4 in EmulationStation, or connect to your RetroPie from Putty):

sudo apt-get install openvpn

 

Run OpenVPN in the background

If you run OpenVPN from bash the usual way, it will run the service, but you can’t type any commands (e.g. to type “emulationstation” to get back to the fun).

To run OpenVPB in the background, let’s first check the current IP address (with no VPN connection):

curl -s checkip.dyndns.org | sed -e 's/.*Current IP Address: //' -e 's/<.*$//'

 

Depending on your service provider, you will have to find a way to make a configuration file. My service providers let me download it directly from their site.

Copy the configuration file to a folder on Raspberry, then run OpenVPN with the –daemon option at the end to run in in the background:

sudo ~/openvpn --config RetroPie/roms/openvpn/New\ York.ovpn --daemon

 

Check that VPN service is running

You can check that OpenVPN is running using either of the following commands:

top

There is also an improved version of top, but this have to be installed:

sudo apt-get install htop

ps -A is also an option to see programs running.

 

Finally, check that your IP address has changed after launching OpenVPN:

curl -s checkip.dyndns.org | sed -e 's/.*Current IP Address: //' -e 's/<.*$//'

 

 

 

 

 

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s