Please follow these steps if you want to setup a pptp vpn from debian:
1. SSH into the debian server
2. Install pptpd with command:
apt-get install pptpd
3. Setup host ip and client ip range. Open file: /etc/pptpd.conf with text editor, and at the content below at the end:
localip is the ip of your server in the virtual network, remote ip the pool range of the client, will assigned by the server automatically when client connects in. Also, please use the ip range not already use in your real lan, my home lan is in 192.168.1.x, so here I use 192.168.0.x
4. Config pptp dns, open file /etc/ppp/options.pptpd, find the line ms-dns and setup as below:
Here I setup with google dns, you are free to use your own dns if you have. But safe with google.
5. Setup client account, open file: /etc/ppp/chap-secrets, and add the line like this:
testuser pptpd testpassword *
testuser is the username, testpassword is the password of the client.
6. Setup ip forward in /etc/sysctl.conf, find the line net.ipv4.ip_forward and edit like below:
save the config and run the command below to load the setting:
run sysctl –p
7. Setup iptables, run command like this:
iptables -t nat -A POSTROUTING -s 192.168.0.0/24 -o eth0 -j MASQUERADE
Change the 192.168.0.0 to match the value you use in step 3. And you may need be to change eth0 to other values where your internet connection is on.
This is all the steps you need to setup the pptp server. Now you can setup a connection in Control Panel\All Control Panel Items\Network and Sharing Center:
Click the link as the red box show above, and follow the wizard to setup a vpn connect and make a test run.
If you have successfully setup the pptp vpn and able to access websites from it, but you are experiencing strange problem and can’t access some of the sites like: www.alexa.com, check my post here for a possible fix: Can’t access certain sites with pptp
To setup a IPSec L2TP VPN, you may want to look here:
Setting up an L2TP/IPSec server on Debian
Setting Up an IPSec L2TP VPN server on Ubuntu for Windows clients