So I needed to VPN into works PPTP server running on NT4 and I was sick of using Windows to do it, so I figured it was time to bite the bullet and figure out how to do it. It's basically pretty easy, the only thing that is sucky is configuring the PPP part.
- Install the PPTP package:
# apt-get install pptp-linux
Setup your /etc/ppp/chap-secrets file by adding these lines to it:
DOMAIN\\username VPNSERVER secretpassword
- Try to connect
# pptp VPNSERVER noauth name DOMAIN\\username remotename VPNSERVER
- Test your by running ifconfig (you should have a ppp0 interface now). Full testing is beyond the scope of this but ifconfig, ping and plog should get you a healthy way through the process. Remember though that until you setup a route and DNS all you're going to be able to do is ping, by IP address, the remote end of your PPP link.
If the above test works now you can streamline it a bit by creating a file called /etc/ppp/peers/pptp and putting these lines in it:
noauth usepeerdns name DOMAIN\\username remotename VPNSERVER
And now that you've defined your PPP options in a file you don't have to put them on the CommandLine anymore, all you have to do is call the PPTP program like this:
# pptp VPNSERVER call pptp
- Setup a route so you can get to the rest of the remote network. In the below example 172.16.1.4 is the IP address of the VPNSERVER.
# route add -net 172.16.0.0 netmask 255.255.0.0 gw 172.16.1.4
Notes:
- Hopefully the tokens I've used are obvious, but in case they aren't here here they are defined:
- VPNSERVER - the hostname (or IP) of the server you want to make the PPTP connection to.
- DOMAIN - the Windows domain name that you want to authenticate to.
- username - the Windows username you want to authenticate as.
- secretpassword - the password that username uses to login with.j
- VPNSERVER is the name of the
- Make sure that VPNSERVER is exactly the same in all the places you use it. Use either the FQDN or the hostname, don't mix and match.
The PPP usepeerdns creates an /etc/ppp/resolv.conf if any DNS servers were assinged by the PPTP server. This file can be used as a direct replacement for your normal /etc/resolv.conf file.
You can add the option debug to either the PPTP CommandLine or the provider file if you've having trouble debugging it and need more info.
There is a PPTP proxy program for Linux that can be found here.
See Also: http://tiki-lounge.com/~ben/software/pptp.html