Debian Tutorials

Debian Tutorials


Step by step tutorials showing you how to install and configure various applications and services on Debian based Linux distros.

December 2018
M T W T F S S
« Apr    
 12
3456789
10111213141516
17181920212223
24252627282930
31  

Categories


Installing and configuring PPTP VPN server on lenny

Ástþór IPÁstþór IP

If you would like to setup a Virtual Private Network (VPN) for Windows clients, PPTP is a great choice. It’s easy to set up on the server and you don’t need any additional software for the Windows clients to connect.

1. Install the required packages

apt-get install pptpd

2. Configure the IP range assigned to clients (pico /etc/pptpd.conf)

localip 192.168.1.2
remoteip 192.168.1.10-20

Using this config the clients are assigned any IP address between and including 192.168.1.10 and 192.168.1.20.

3. Restart the PPTP daemon

/etc/init.d/pptpd restart

4. Create a user allowed to connect (pico /etc/ppp/chap-secrets)

user1 pptpd secretpassword *

Passwords are not encrypted. This allows the a user with the username: user1 and the password: secretpassword to login from any ip address.

5. Enable IP forward at startup to allow the VPN clients to connect to the server’s local network. (pico /etc/sysctl.conf)

net.ipv4.ip_forward=1

Also run this command to activate the IP forward instantly:

echo 1 > /proc/sys/net/ipv4/ip_forward

6. Create a routing rule to allow the VPN clients to route network traffic through the server.

iptables -t nat -A POSTROUTING -o eth0 -j MASQUERADE

Read this tutorial to learn how to create iptables rules on startup:
Loading iptables rules on startup

Comments 13
  • Marinello12
    Posted on

    Marinello12 Marinello12

    Author

    Nice thanks for this, this will help me alot 🙂


  • DLS
    Posted on

    DLS DLS

    Author

    I’m not too sure what the “POSTROUTING” and “MASQUERADE” in “iptables -t nat -A POSTROUTING -o eth0 -j MASQUERADE” should be set to.

    Care to explain?


  • noob
    Posted on

    noob noob

    Author

    thanks the quick howto and works 😀


  • noob
    Posted on

    noob noob

    Author

    DLS without that iptable rule the clients cant connect to the internet 😀


  • BlackBox
    Posted on

    BlackBox BlackBox

    Author

    how can we monitor PPTP Users and the traffic and bandwidth …. everything…?


  • W H
    Posted on

    W H W H

    Author

    /etc/init.d/pptpd restart
    -bash: /etc/init.d/pptpd: Permission denied


  • ford_focus
    Posted on

    ford_focus ford_focus

    Author

    W H, do it under root


  • Lukas
    Posted on

    Lukas Lukas

    Author

    Hello there. Thanks for very nice PPTP VPN manual. I got just one question. IS it possible to monitor users traffic on VPN ? Give users quota for VPN ? Problem is on my server is users making too mutch traffic and i need to stop this. Thanks for any help. lu


  • Alexey
    Posted on

    Alexey Alexey

    Author

    Lukas, use tc utility with htb tool to shape the traffic. Examine lartc.org please.
    And you can monitor the usage with snmp + mrtg. I don’t know if there is some tool out of the box for doing everything this.


  • Boss
    Posted on

    Boss Boss

    Author

    /etc/init.d/pptpd restart
    Restarting PPTP:
    Stopping PPTP: pptpd.
    Starting PPTP Daemon: pptpd.

    work perfectly thx


  • Babar
    Posted on

    Babar Babar

    Author

    Can’t browse HTPPS sites, not even https://www.google.com, But normal sites are okay. What’s the problem?


  • Andres
    Posted on

    Andres Andres

    Author

    No se pudo establecer la conexión remota porque se produjo un error en los túneles VPN probados. Puede que el servidor VPN esté inaccesible. Si la conexión está intentando usar un túnel L2TP/IPsec, es posible que los parámetros de seguridad necesarios para la negociación IPsec no estén configurados correctamente.


  • ahong
    Posted on

    ahong ahong

    Author

    waw this is what i loooking for
    tengks mastah 🙂