Setting up a VPN on Linux

Posted: 01/31/2012 in Linux Hacking

After a nice and successful tutorial on how to set a Sprire proxy server, I would like to write an entry on how to configure a VPN on Linux so as to connect your iPhone from everywhere for your proxy.

What you need / Prerequesites

– running linux ( examples here are for debian, opensuse, ubuntu)
– Internet access

Installing VPN Server (pptpd)

Installing the VPN Server ( pptpd daemon ) depends on your system. Choose your System:

1. Debian / Ubuntu

Debian: apt-get install pptpd
Ubuntu: sudo apt-get install pptpd

2. OpenSuse

zypper install pptpd

Configure your VPN Server

There are 3 important files for running a VPN Server on your Linux Box. The names are different between the Systems, but I show you here how to configure it no matter which linux you use.
pptpd.conf

The most important file is the /etc/pptpd.conf file. For installing the default file use:

cd /etc
wget http://www.ketchup-mayo-senf.de/blog/pptpd.conf
( For Ubuntu Users use “sudo” in front of this command )

Edit this file and edit the option “remoteip” and set this to an ip-range matching your Network configuration ( in my case 192.168.18.234-238)

options.pptpd

This file includes some minor configurations like dns server etc.

cd /etc/ppp
wget http://www.ketchup-mayo-senf.de/blog/options.pptpd
( For Ubuntu Users use “sudo” in front of this command )

Edit the option “ms-dns” and set ip to your linux box ( or the box which is running fakedns or dnsmasq)
chap-secrets

cd /etc/ppp
wget http://www.ketchup-mayo-senf.de/blog/chap-secrets
( For Ubuntu Users use “sudo” in front of this command )

Here you can edit the user credentials. By default its:

User: KMS
Password: siri

It is better to change that!

Configure your iPhone

In Settings you’ll find a VPN Tab.
– Select “PPTP”
– Description: thats up to you
– Server: your linux box ip ( best use dyndns )
– Account: KMS ( if using default user. else put here your user name)
– Password: siri ( if using default password. else put here your own password)

Thats all. After that you can connect very easy: just enable the slider

Main Source: http://www.ketchup-mayo-senf.de/blog

Advertisements
Comments
  1. Appreciate it for this post, I am a big fan of this internet site would like to keep updated.

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 )

Twitter picture

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

Facebook photo

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

Google+ photo

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

Connecting to %s