Recently I had the need to connect to a remote VPN server from my Debian box but as I don’t run ‘X’ it had to be done via the command line, after some experimenting I found this simple solution.
apt-get install pptp-linux
Create a file in /etc/ppp/peers to associate with your connection ie /etc/ppp/peers/myvpn
add the following text
pty "pptp HOSTNAME –nolaunchpppd –debug"
name USERNAME
password PASSWORD
remotename PPTP
require-mppe-128
require-mschap-v2
refuse-eap
refuse-pap
refuse-chap
refuse-mschap
noauth
debug
persist
maxfail 0
defaultroute
replacedefaultroute
usepeerdns
Where HOSTNAME is the hostname of the vpn server your connecting to ie my.vpn.com, USERNAME is the username and PASSWORD is the pasword.Save and exit file.
To connect use
pon myvpn (where myvpn is the name of the file you created in /etc/ppp/peers/)
check syslog for connection debug
ifconfig will show a new interface created.
to disconnect do
poff myvpn (where myvpn is the name of the file you created in /etc/ppp/peers/)