Tuesday, September 28, 2010

set up PPTP VPN server (debian linux)

On the server side:
  • First of all, you need to install the PPTP package (apt-get install pptpd).
  • Then, you need to configure PPTP. In the /etc/pptpd.conf file add the following lines:
localip 192.168.1.2
remoteip 192.168.1.20-25

The localip address is the ip of the machine that pptpd runs on and the remoteip is the range of ips that will be used by the clients.

  • The DNS server should be added in the /etc/ppp/pptpd-options file. The entry should look like this:
ms-dns 194.219.227.2
ms-dns 193.92.150.3
(use your isp's dns servers)


  • The vpn users should be declared in /etc/ppp/chap-secrets
# client server secret IP addresses
username pptpd password *

  • In order to avoid the error described in this bug report, in /etc/pptpd.conf comment the logwtmp line
  • Ip forwarding needs to be enabled in /etc/sysctl.conf ; uncomment the net.ipv4.ip_forward=1 line.
  • Restart pptpd (/etc/init.d/pptpd restart) and networking (/etc/init.d/networking restart)
  • You should use a service like dyndns to get a hostname (unless you have a static ip anyway) and configure your router to forward port 1723 traffic to the server machine.
On the client side:

  • Install the following packages: pptp-linux, network-manager-pptp , network-manager-pptp-gnome
  • Open "edit connections" on network manager.
  • On the VPN tab add a new PPTP connection.
  • The gateway should be set to the external ip of the server machine (e.g. dyndns host account). The username and the password should be set as in the /etc/ppp/chap-secrets file
  • In the Advanced options, enable the "use point-to-point encryption (MPPE)" option and MSCHAP and MSCHAP2 authentication methods.



















  • You should be able to connect now.

No comments: