Home » Uncategorized » How To Setup Your Own VPN With PPTP on Debian/Ubuntu

How To Setup Your Own VPN With PPTP on Debian/Ubuntu

This guide is intended for those who want to set up a PPTP VPN on OpenVZ with Debian or Ubuntu on a capable provider such as Ramnode.com. Lots of time has been spent through trial and error trying to figure it out.

To verify PPP is working, run:
cat /dev/ppp
It should return this:

cat: /dev/ppp: No such device or address

Server Setup:

1. Install the pptp server package:
apt-get install pptpd
2. Edit the “pptpd.conf” configuration file:
vim /etc/pptpd.conf
Uncomment the localip and remoteip lines and change them to something like this:

Where the “localip” is the address of your VPS, and the remoteip are the addresses that will be handed out to the clients, it is up to you to adjust these for your network’s requirements.

3. Edit the “pptpd-options” configuration file:
vim /etc/ppp/pptpd-options
Uncomment the ms-dns lines and change them to:

Where the IP used for the ms-dns line is the DNS server for the local network your client will be connecting to. In my example, I used OpenDNS’s DNS servers.

4. Edit the “chap-secrets” file:
vim /etc/ppp/chap-secrets
Add the authentication credentials for a user’s connection, in the following syntax:

username<tab>*<tab> userpassword<tab>*

Make sure that you separate each entry with a single tab. It could be like this:
john    *    jsmith88    *
5. Edit the MTU settings:
vim /etc/ppp/ip-up
Add this line to the end of the file:
ifconfig $1 mtu 1400
6. Allow PPTP through the firewall (iptables):
iptables -t nat -A POSTROUTING -j SNAT --to-source
Change to your VPS’s public IP address.

After that, type in:
7. Restart the pptpd for the settings to take affect:
/etc/init.d/pptpd restart
If you don’t want to grant yourself access to anything beyond the server, then you’re done on the server side

About admin

I have been working with Linux based systems since 2002. I hope the article published on this site will be useful to those new to server administration.