Making Sense of Location Based Services

Arch Linux OpenVPN Server on Raspberry Pi

Brief introduction

After reading so many articles in setting up a VPN for the Raspberry Pi the one used in this guide was published in Linux User and Developer Magazine. Whilst the article is excellent, expanded notes have been added for those new to Linux. This is split over three posts so please be patient.

Arch Linux has been used as the OS for the OpenVPN Server on the Raspberry Pi and for the OpenVPN Client the OS given reference to is any Debian based OS.

The following link sums up what an OpenVPN is;

http://en.wikipedia.org/wiki/OpenVPN

and for the Arch Linux description please see the following summary;

  1. OpenVPN is a robust and highly flexible VPN daemon. OpenVPN supports SSL/TLS security, Ethernet bridging, TCP or UDP tunnel transport through proxies or NAT, support for dynamic IP addresses and DHCP, scalability to hundreds or thousands of users, and portability to most major OS platforms.
  2. OpenVPN is tightly bound to the OpenSSL library, and derives much of its crypto capabilities from it.
  3. OpenVPN supports conventional encryption using a pre-shared secret key (Static Key mode) or public key security (SSL/TLS mode) using client & server certificates. OpenVPN also supports unencrypted TCP/UDP tunnels.
  4. OpenVPN is designed to work with the TUN/TAP virtual networking interface that exists on most platforms.
  5. Overall, OpenVPN aims to offer many of the key features of IPSec but with a relatively lightweight footprint.
  6. OpenVPN was written by James Yonan and is published under the GNU General Public License (GPL).

source: http://en.wikipedia.org/wiki/OpenVPN

Preparation

OpenVPN Client on the Raspberry Pi – Please note that because Arch Linux is a rolling release, “netcfg” is not available in the main repos. Also GUI is a not default on Arch so there is a reliance on the command line.

For instructions on flashing the latest Arch Linux ARM image please see the following link;

http://archlinuxarm.org/platforms/armv6/raspberry-pi#qt-platform_tabs-ui-tabs2

The user name is root and the password is root at the Arch Linux login prompt. If you are using wireless rather than wired connection then run the following command to gain internet access;

wifi-menu

Choose the correct AP, then run the following command;

pacman -Syu

to update system.

The VPN server on this set-up for the Raspberry Pi is be made up of the following software components:

  1. Base Arch Linux system
  2. OpenVPN – the software used to create a secure VPN
  3. Netcfg – used to easily manage the multiple network adapters needed
  4. Bridge-utils – used to bridge the VPN and Ethernet adaptors
  5. SSH – will provide secure remote access to the Raspberry Pi and the files on it

To download the main components as listed bar “netcfg” run the following command;

pacman -S noip bridge-utils openvpn

Netcfg is based in the unofficial arch repos (AUR). So to download any packages from here you will need packer or another program like yaourt. To download yaourt run the following;

curl -O https://aur.archlinux.org/packages/pa/package-query/package-query.tar.gz

tar zxvf package-query.tar.gz

cd package-query

makepkg -si

cd ..

curl -O https://aur.archlinux.org/packages/ya/yaourt/yaourt.tar.gz

tar zxvf yaourt.tar.gz

cd yaourt

makepkg -si

cd ..

Part 2

Latest Posts

  • RFID, Raspberry Pi & LBS
    The experimentation with Raspberry Pi goes on. RFID is the next stage in effective Indoor Location Based Services and to understand this the following is a small project that brings RFID to the Raspberry Pi. A brief history of the...
    Read more
  • Hacking Location Based Services & IoT with the Raspberry Pi
    Introduction There are very exciting topics that influenced me over the past few years namely Location Based Services (LBS), The Internet of Things (IoT) and the humble Raspberry Pi.  But first a brief background – I am not a technical...
    Read more
  • Arch Linux OpenVPN Server on Raspberry Pi (part 2)
    Once yaourt has been configured, download the “netcfg” package by issuing the following commands; yaourt netcfg There will be a list of programs that have netcfg as a search string. Choose the netcfg by the appropriate number: If you are...
    Read more
LBSZone
Linux Format Magazine

Twitter: global_lbs