Konubinix' opinionated web of thoughts

Connecting to a PPTP VPN Server


1 Connection to pptp/vpn :

1.1 The connection :


aptitude install pptp-linux

obtain from your PPTP Server administrator:

the IP address or host name of the server ($SERVER),
the name you wish to use to refer to the tunnel ($TUNNEL),
the authentication domain name ($DOMAIN),
the username you are to use ($USERNAME),
the password you are to use ($PASSWORD),
whether encryption is required.

In the steps below, substitute these values manually. For example, where we write $PASSWORD we expect you to replace this with your password.

create or edit the /etc/ppp/options.pptp file, which sets options common to all tunnels:

lock noauth nobsdcomp nodeflate

create or add lines to the /etc/ppp/chap-secrets file, which holds usernames and passwords:


Note: if you are using a PPTP Server that does not require an authentication domain name, omit the slashes as well as the domain name.

Note: if the passwords contain any special characters, quote them. See man pppd for more details.

create a /etc/ppp/peers/$TUNNEL file:

pty “pptp $SERVER –nolaunchpppd”
name $DOMAIN\\$USERNAME # refers to the /etc/ppp/chap-secrets entry
remotename PPTP # refers to the /etc/ppp/chap-secrets entry
file /etc/ppp/options.pptp
ipparam $TUNNEL

Note: if you do not need MPPE support, then remove the require-mppe-128 option from this file and /etc/ppp/options.pptp.

start the tunnel using the pon command:


to further diagnose a failure, add options to the command:

pon $TUNNEL debug dump logfd 2 nodetach

Note: we have further information on enabling debug mode, and on diagnosing problems.

stop the tunnel using the poff command:

poff $TUNNEL

1.2 Add routing rules :

sudo route add -net $PPP_TUNNEL_ADDRESS_BROADCAST netmask dev $PPP_TUNNEL

Example :

sudo route add -net netmask dev ppp0