Install PPTPD in Centos (including one-key package)
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:
1
mknod /dev/ppp c 108 0
Set this item to load when vps is started, edit/etc/rc. local, and add:
1
mknod /dev/ppp c 108 0
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:
1
/sbin/sysctl -p
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 savechkconfig iptables onchkconfig pptpd onservice iptables startservice pptpd start
One-click package installation address: pptpd. sh