Notes for pptp-linux
Step 1 - Google search for pptp linux source code
Result was this page: http://pptpclient.sourceforge.net/cvs.phtml
Which led me to this command to download the source code:
cvs -z9 -d :pserver:anonymous@pptpclient.cvs.sourceforge.net:/cvsroot/pptpclient checkout pptp-linux
After running make and make install successfully, I now needed to configure pptp to actually work. pppd was already installed on my machine, which was a prereq for running make.
I used the following page to help me configure the pptp client:
http://pptpclient.sourceforge.net/howto-debian.phtml#configure_by_hand
I followed all
- 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:
$DOMAIN\\$USERNAME PPTP $PASSWORD * 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. (I did not include $domain. My entry looked like this: username PPTP "[mypassword]" *. I used one tab between each field.)
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
remotename PPTP
require-mppe-128
file /etc/ppp/options.pptp
ipparam $TUNNELNote: if you do not need MPPE support, then remove the require-mppe-128 option from this file and /etc/ppp/options.pptp. (I followed the thing above exactly. The $TUNNEL file can be any name you give it. Later when you run pon, you will supply the same filename you supplied for $TUNNEL. Also, you can't easily cd to the peers directly. Just sudo and directly create the file.)
- start the tunnel using the pon command:
pon $TUNNEL 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. (I found this line for debugging very useful. On ubuntu, of course, I had to sudo this command)
- stop the tunnel using the poff command:
poff $TUNNEL
To get to the rest of the network, edit these files:
/etc/ppp/ip-up
Add this line to the bottom of the file:
route add default dev $1
/etc/ppp/ip-down
Add this line to the bottom of the file:
route del default dev $1
Voila! It worked! Now when I need to PPTP into my office, I just type sudo pon name-of-tunnel-file to get in, and sudo pon off to log off.
Finally, one small detail is that my network at home is set to a different subnet than the one in the office, which is a prerequisite. For example, if both the home LAN and office LAN relied on 192.168.1.x, I believe PPTP would not have worked properly.