Jump to content











Photo
- - - - -

Setting up PPTP VPN connection.


  • Please log in to reply
2 replies to this topic

#1 Mikorist

Mikorist

    ▂ ▃ █ ▅ ▆

  • Advanced user
  • 771 posts
  •  
    United Nations

Posted 26 November 2008 - 12:48 PM

Install PPTP Client from the Debian Project:
sudo apt-get install pptp-linux

make pptpvpn file:
#!/bin/bash

function routeadd {

   route add -host 61.xxx.xxx.xxx dev ppp0

   route add -host 62.xxx.xxx.xxx dev ppp0

   route add -host 63.xxx.xxx.xxx dev ppp0

}

function makepptp {

   echo pty \"pptp VPN.SERVER.COM --nolaunchpppd\" >> /etc/ppp/peers/pptpvpn;

   echo remotename PPTP >> /etc/ppp/peers/pptpvpn;

   echo require-mppe-128 >> /etc/ppp/peers/pptpvpn;

   echo file /etc/ppp/options.pptp >> /etc/ppp/peers/pptpvpn;

   echo ipparam pptpvpn >> /etc/ppp/peers/pptpvpn;

pppd call pptpvpn &

}

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/pptpvpn ];

	then

	rm /etc/ppp/peers/pptpvpn;

	echo name $1 >> /etc/ppp/peers/pptpvpn;

	makepptp;

	sleep 8;

	routeadd;

else

	echo name $1 >> /etc/ppp/peers/pptpvpn;	

	makepptp;

	sleep 8;

	routeadd;

fi
Where,
pty \"pptp VPN.SERVER.COM --nolaunchpppd\"
Specifies that the command script is to be used to communicate rather than a specific terminal device. In this case we are using pptp client to establishes the client side of a Virtual Private Network (VPN) using the Point-to-Point Tunneling Protocol (PPTP).
VPN.SERVER.COM is host name (or IP address) for the VPN server

route add -host 63.xxx.xxx.xxx dev ppp0 - this will tell which hosts are on the other side of tunnel. (host name or IP address)

Close and save the file.
chmod +x pptpvpn

sudo ./pptpvpn username password

If everything is went correctly you should be online and ppp0 should be up. Remote server will assign IP address and other routing information

Disconnect PPTP server vpn connection
Simply kill pppd service, enter:
killall pppd

it will work on any distribution, its just a matter of
pptp package you will have to install..

#2 Mikorist

Mikorist

    ▂ ▃ █ ▅ ▆

  • Advanced user
  • 771 posts
  •  
    United Nations

Posted 27 November 2008 - 10:53 AM

I also added this staff onto the wiki pages in the hope it helps more people finding it:


Setting up PPTP VPN connection in konsole

Setting up PPTP VPN connection in konsole

:)

#3 Nuno Brito

Nuno Brito

    Platinum Member

  • .script developer
  • 10544 posts
  • Location:boot.wim
  • Interests:I'm just a quiet simple person with a very quiet simple life living one day at a time..
  •  
    European Union

Posted 27 November 2008 - 12:23 PM

Thanks for the tutorial.

I've only had attempted something like this some years ago with windows machines, and it was a life saver at the time.

:)




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users