O cliente PPTP não se conecta por linha de comando

1

Eu preciso me conectar a uma VPN PPTP para acessar algumas máquinas via SSH.

A máquina que estou usando para isso é um servidor Ubuntu 14.04.

Eu configurei /etc/ppp/peers/vpn assim:

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

E /etc/ppp/options.pptp contém o seguinte:

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

nobsdcomp
nodeflate
nodefaultroute  

E /etc/ppp/chap-secrets é assim:

domain\user vpn "secret" *

Mas quando eu chamo sudo pon vpn , ele não é executado.

Aqui está o meu 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.
    
por ayr-ton 26.02.2015 / 08:49

1 resposta

0

Experimente este script Salve-o com o nome 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

Uso

sudp / path_to_script / vpn senha do nome de usuário

No script:

xxx.xxx.xxx.xxx - representa a rede por trás do servidor vpn com o qual você deseja acessar

yyy.yyy.yyy.yyy - representa a máscara de rede

zzz.zzz.zzz.zzz - representa o ip do servidor vpn.

    
por 2707974 27.02.2015 / 08:32