This tutorials will help you to install PPTP vpn on Xen vps.
PPTP installation:
Debian
1 |
apt-get install pptp |
CentOS
1 |
yum -y install pptp |
Configuration:
Open /etc/pptpd.conf and add following 2 lines
1 |
nano -w /etc/pptpd.conf |
1 2 |
localip 123.123.123.123 remoteip 192.168.1.1-200 |
Replace 123.123.123.123 with public ip of your vps
Now open /etc/ppp/options.pptpd and add dns server ip
1 |
ms-dns 8.8.8.8 |
8.8.8.8 is google public dns, you can use your host dns server or opendns dns ips
Now set client username/password to connect to your vpn. For this, open /etc/ppp/chap-secrets and add your vpn client username and password in following format
1 |
username TAB pptp TAB password TAB* |
Press TAB button where TAB in above command
If you want to assign a static ip to your customer, then you can add this ip at the end instead of *
1 |
username TAB pptp TAB password TAB 192.168.1.33 |
Your pptp vpn is ready to use, but now you need to enable ipv4 forwarding in your vps
Open /etc/sysctl.conf and uncomment
1 |
net.ipv4.ip_forward = 1 |
Run
1 |
sysctl -p |
And add iptables rules to forward traffic of local ips to Internet gateway which is the public ip of your vps
1 |
iptables -t nat -A POSTROUTING -s 192.168.1.0/24 -o eth0 -j MASQUERADE |
Start pptpd service
1 |
/etc/init.d/pptpd start |
Now configure your vpn client and try to connect it and enjoy happy connecting 🙂
Comment Policy:
Your words are your own, so be nice and helpful if you can. Please, only use your real name, not your business name or keywords. Using business name or keywords instead of your real name will lead to the comment being deleted. Anonymous commenting is not allowed either. Limit the amount of links submitted in your comment. We accept clean XHTML in comments, but don't overdo it please.