PhotonVPS XEN VPS搭建PPTP服务(CentOS 5.7 64bit)

1.Frist, make sure you have ppp installed

yum install -y ppp iptables

yum install perl


2.Download lastest version pptpd rpm package

wget http://acelnmp.googlecode.com/files/pptpd-1.3.4-1.rhel5.1.x86_64.rpm


3.Installing the rpm

rpm -ivh pptpd-1.3.4-1.rhel5.1.i386.rpm


4.Open the file /etc/ppp/options.pptpd

vi /etc/ppp/options.pptpd

Uncomment the ms-dns lines (by removing the ‘#’ in front of them) and change them to the dns servers provided by your ISP or to public DNS servers like ones provided by OpenDNS.

ms-dns 208.67.222.222
ms-dns 208.67.220.220


5.Open the file /etc/ppp/chap-secrets

vi /etc/ppp/chap-secrets

Add usernames and passwords for your clients. You need to enter the usernames and passwords in the following format.

myusername pptpd mypassword *


6.Open the file /etc/pptpd.conf

vi /etc/pptpd.conf

Go to the end of the file where you can see examples of localip and remoteip. Below them add your own values for localip and remoteip.

localip 192.168.8.1
remoteip 192.168.8.101-200


7.Open the file /etc/sysctl.conf

vi /etc/sysctl.conf

Enable IP forwarding and make the changes to sysctl.conf take effectnet.ipv4.ip_forward = 1
/sbin/sysctl -p


8.Configure iptables to do NAT.

/sbin/service iptables start
/sbin/iptables -t nat -A POSTROUTING -o eth0 -s 192.168.8.0/24 -j MASQUERADE
service iptables save


9.Finally, Start the pptp service

/sbin/service pptpd start
chkconfig pptpd on

 

posted @ 2013-03-07 21:25  HaipingWuiOS  阅读(381)  评论(0编辑  收藏  举报