Thursday, May 1, 2008

PPTP client config on Ubuntu 8.04

- install client program
sudo apt-get install pptp-linux
- create the /etc/ppp/options.pptp file, which sets options common to all tunnels :
lock noauth nobsdcomp nodeflate
Here is my smaple file :

# Lock the port

# Authentication
# We don't need the tunnel server to authenticate itself

# We won't do EAP, CHAP, or MSCHAP, but we will accept MSCHAP-V2

# Compression
# Turn off compression protocols we know won't be used
- create or add lines to the /etc/ppp/pap-secrets file, which olds usernames and passwords :
Here is my smaple file :

# INBOUND connections

# Every regular user can use PPP and has to use passwords from /etc/passwd
* hostname "" *

# UserIDs that cannot use PPP at all. Check your /etc/passwd and add any
# other accounts that should not be able to use pppd!
guest hostname "*" -
master hostname "*" -
root hostname "*" -
support hostname "*" -
stats hostname "*" -

# OUTBOUND connections

# Here you should add your userid password to connect to your providers via
# PAP. The * means that the password is to be used for ANY host you connect
# to. Thus you do not have to worry about the foreign machine name. Just
# replace password with your password.
# If you have different providers with different passwords then you better
# remove the following line.

# * password
shams kw pass *

- Create a /etc/ppp/peers/$TUNNEL file :

pty "pptp $SERVER --nolaunchpppd"
file /etc/ppp/options.pptp
ipparam $TUNNEL

Here is my file :

# tunnel Internet, written by pptpconfig $Revision: 1.12 $

# name of tunnel, used to select lines in secrets files
remotename kw

# name of tunnel, used to name /var/run pid file
linkname kw

# name of tunnel, passed to ip-up scripts
ipparam kw

# data stream for pppd to use
pty "pptp --nolaunchpppd "

# domain and username, used to select lines in secrets files
name shams


# do not require the server to authenticate to our client

# adopt defaults from the pptp-linux package
file /etc/ppp/options.pptp

# end of tunnel file

- start your connection with pon command :

sudo pon kw

- stop your connection with poff command :

sudo poff kw