Monthly Archives: July 2010

Redhat/CentOS 5 Linux PPTP VPN Setup

1. Install the Yum Repository for PPTP

rpm -Uvh http://pptpclient.sourceforge.net/yum/stable/rhel5/pptp-release-current.noarch.rpm

2. Then proceed with installing ppp & pptpd

yum install ppp
yum –enablerepo=pptp-stable install pptp

On newer CentOS distributions, ppp is already installed and at 2.4.4 or later, as of this writing pptpd needs 2.4.3 , so you may need to remove ppp and have yum install it automatically as a dependancy of pptpd

3. After installation finnish open /etc/pptpd.conf and change the configuration for localip & remoteip

localip 10.0.0.1
remoteip 10.0.0.100-120

4. After that open the file / etc / ppp / options.pptpd and change sesuia ms-dns dns server / isp you (I filled in with open dns ip)

ms-dns 8.8.8.8
ms-dns 8.8.4.4

5. Then make your VPN use

echo “username pptpd password *”>> / etc / ppp / chap-secrets

IP Forwarding & Nat
1. Set IPForward

edit /etc/sysctl.conf and update

net.ipv4.ip_forward = 1

Then run `sysctl -p` to make the system update itself with the above param.

2. Set Nat

Add the following to /etc/sysconfig/iptables to add a new nat chain/rule

:PREROUTING ACCEPT [5476825:840006712]
:POSTROUTING ACCEPT [11279:680432]
:OUTPUT ACCEPT [10099:609991]
-A POSTROUTING -s 10.0.0.0/255.255.255.0 -o eth1 -j MASQUERADE
COMMIT