I need to connect to a PPTP VPN in reason to access some machines via SSH.

The machine I'm using to this is a Ubuntu 14.04 Server.

I set up /etc/ppp/peers/vpn like this:

pty "pptp 1.2.3.4 --nolaunchpppd"
name domain\\user
remotename vpn
require-mppe-128
mppe-stateful
file /etc/ppp/options.pptp
ipparam vpn

And /etc/ppp/options.pptp contains the following:

lock
noauth
refuse-pap
refuse-eap    
refuse-chap
refuse-mschap

nobsdcomp
nodeflate
nodefaultroute  

And /etc/ppp/chap-secrets is like this:

domain\\user vpn "secret" *

But when I call sudo pon vpn it doesn't run.

Here's my syslog:

pppd[11138]: pppd 2.4.5 started by secret-user, uid 0
pppd[11138]: Using interface ppp0
pppd[11138]: Connect: ppp0 <--> /dev/pts/0
pptp[11141]: anon log[main:pptp.c:314]: The synchronous pptp option is NOT activated
pptp[11210]: anon log[ctrlp_rep:pptp_ctrl.c:251]: Sent control packet type is 1 'Start-Control-Connection-Request'
pptp[11210]: anon log[ctrlp_disp:pptp_ctrl.c:739]: Received Start Control Connection Reply
pptp[11210]: anon log[ctrlp_disp:pptp_ctrl.c:773]: Client connection established.
pptp[11210]: anon log[ctrlp_rep:pptp_ctrl.c:251]: Sent control packet type is 7 'Outgoing-Call-Request'
pptp[11210]: anon log[ctrlp_disp:pptp_ctrl.c:858]: Received Outgoing Call Reply.
pptp[11210]: anon log[ctrlp_disp:pptp_ctrl.c:897]: Outgoing call established (call ID 0, peer's call ID 62964).
pptp[11210]: anon log[logecho:pptp_ctrl.c:677]: Echo Request received.
pptp[11210]: anon log[ctrlp_rep:pptp_ctrl.c:251]: Sent control packet type is 6 'Echo-Reply'
pptp[11210]: anon log[logecho:pptp_ctrl.c:677]: Echo Request received.
pptp[11210]: anon log[ctrlp_rep:pptp_ctrl.c:251]: Sent control packet type is 6 'Echo-Reply'
pptp[11210]: anon log[logecho:pptp_ctrl.c:677]: Echo Reply received.
pptp[11210]: anon log[ctrlp_disp:pptp_ctrl.c:912]: Received Call Clear Request.
pptp[11210]: anon log[pptp_read_some:pptp_ctrl.c:544]: read returned zero, peer has closed
pptp[11210]: anon log[callmgr_main:pptp_callmgr.c:258]: Closing connection (shutdown)
pptp[11210]: anon log[ctrlp_rep:pptp_ctrl.c:251]: Sent control packet type is 12 'Call-Clear-Request'
pptp[11210]: anon log[pptp_read_some:pptp_ctrl.c:544]: read returned zero, peer has closed
pptp[11210]: anon log[call_callback:pptp_callmgr.c:79]: Closing connection (call state)
pppd[11138]: Modem hangup
pppd[11138]: Connection terminated.
pppd[11138]: Exit.
share|improve this question
    
Try to change setup, on server and cilent, to do not use mppe – 2707974 Feb 26 '15 at 9:41
    
I can't change the server setup. Is a setup from a third part costumer that our company doesn't have any access. Only to some machines via this VPN :( – ayr-ton Feb 26 '15 at 18:06

Try with this script Save it with name vpn

#!/bin/bash
function routeadd {
    route add -net xxx.xxx.xxx.xxx netmask yyy.yyy.yyy.yyy dev ppp0
}

function makepptp {
   echo pty \"pptp zzz.zzz.zzz.zzz --nolaunchpppd\" >> /etc/ppp/peers/vpn;
   echo remotename PPTP >> /etc/ppp/peers/vpn;
   echo require-mppe-128 >> /etc/ppp/peers/vpn;
   echo file /etc/ppp/options.pptp >> /etc/ppp/peers/vpn;
   echo ipparam vpn >> /etc/ppp/peers/vpn;
pppd call vpn &
}
if [ -a /etc/ppp/chap-secrets ];
        then
        rm /etc/ppp/chap-secrets
    echo $1 PPTP $2 '*' >> /etc/ppp/chap-secrets;
else
    echo $1 PPTP $2 '*' >> /etc/ppp/chap-secrets;
fi

if [ -e /etc/ppp/peers/vpn ];
    then
    rm /etc/ppp/peers/vpn;
    echo name $1 >> /etc/ppp/peers/vpn;
    makepptp;
    sleep 8;
    routeadd;
else
    echo name $1 >> /etc/ppp/peers/vpn;
    makepptp;
    sleep 8;
    routeadd;
fi

Usege

sudp /path_to_script/vpn username password

In script:

xxx.xxx.xxx.xxx - represent network behind vpn server with you wish to access

yyy.yyy.yyy.yyy - represent network mask

zzz.zzz.zzz.zzz - represent ip of vpn server.

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.