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
lock

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

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

# Compression
# Turn off compression protocols we know won't be used
nobsdcomp
nodeflate
- create or add lines to the /etc/ppp/pap-secrets file, which olds usernames and passwords :
$USERNAME $TUNNEL $PASSWORD *
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"
name $USERNAME
require-mppe-128
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 192.168.1.8 --nolaunchpppd "

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

usepeerdns

# do not require the server to authenticate to our client
noauth

# 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