1. delete the previously installed software: 123yumremove-ypptpdppprm-rf/etc/pptpd. confrm-rf/etc/ppp delete iptables rules:
1. delete the previously installed software:
123 |
yum remove -y pptpd ppprm -rf /etc/pptpd.confrm -rf /etc/ppp |
Delete an iptables rule:
1 |
iptables --flush POSTROUTING --table nat |
2. download related software:
1234 |
wget http://www.vpsyou.com/sources/dkms-2.0.17.5-1.noarch.rpmwget http://www.vpsyou.com/sources/kernel_ppp_mppe-1.0.2-3dkms.noarch.rpmwget http://www.vpsyou.com/sources/pptpd-1.3.4-1.rhel5.1.i386.rpmwget http://www.vpsyou.com/sources/ppp-2.4.4-9.0.rhel5.i386.rpm |
3. install related software
123456 |
yum -y install make libpcap iptables gcc-c++ logrotate tar vim-minimal cpio perl pam tcp_wrappersrpm -ivh dkms-2.0.17.5-1.noarch.rpmrpm -ivh kernel_ppp_mppe-1.0.2-3dkms.noarch.rpmrpm -qa kernel_ppp_mpperpm -Uvh ppp-2.4.4-9.0.rhel5.i386.rpmrpm -ivh pptpd-1.3.4-1.rhel5.1.i386.rpm |
4. related configuration:
A. ppp configuration:
Set this item to load when vps is started, edit/etc/rc. local, and add:
Modify the configuration file/etc/ppp/options.ppt pd and add:
12 |
ms-dns 8.8.8.8ms-dns 8.8.4.4 |
B. modify the configuration file/etc/sysctl. conf.
1 |
net.ipv4.ip_forward = 0 |
Is:
1 |
net.ipv4.ip_forward = 1 |
Then execute:
C. configure the/etc/pptpd. conf file and add:
12 |
localip 192.168.9.1remoteip 192.168.9.11-30 |
D. modify the configuration file/etc/ppp/chap-secrets and add:
123 |
# Secrets for authentication using CHAP# client server secret IP addressesmyusername pptpd mypassword * |
PS: myusername is the vpn user name, and mypassword is the password
5. start iptables. add rules to start pptpd
12345678 |
iptables -t nat -A POSTROUTING -s 192.168.9.0/255.255.255.0 -j SNAT --to-source `ifconfig | grep 'inet addr:'| grep -v '127.0.0.1' | cut -d: -f2 | awk 'NR==1 { print $1}'`service iptables save chkconfig iptables onchkconfig pptpd on service iptables startservice pptpd start |
One-click package installation address: pptpd. sh