Before the pptpd record is installed on ubuntu server 11.04, The centos system is installed on the vps. It is used to ubuntu. The yum of centos is not used to it. Just bite your teeth and change ubuntu first, run the pptpd script on centos, check the main settings, install the corresponding program in ubuntu, and finally sort out the script as follows: 01 #! /Bin/bash02 03IP = public network IP04user = vpn05pass = 'openssl rand 6-base64' 06if ["$1 "! = ""] 07 then pass = $ paifi09 10apt-get purge pptpd ppp11iptables -- flush POSTROUTING -- table nat12iptables -- flush FORWARD13rm-rf/etc/pptpd. conf14rm-rf/etc/ppp15 16apt-get install ppp pptpd17 18 echo "net. ipv4.ip _ forward = 1 ">/etc/sysctl. conf19 www.2cto.com 20sed-I "s/exit 0/# exit 0/g"/etc/rc. local21echo "mknod/dev/ppp c 108 0">/etc/rc. local22echo "iptables-t nat-a postrouting-s 172.16.99.0/24-j SNAT -- to-source $ IP">/etc/rc. local23echo "iptables-a forward-p tcp -- syn-s 172.16.99.0/24-j TCPMSS -- set-mss 1356">/etc/rc. local24echo "exit 0">/etc/rc. local25 26 echo "localip 172.16.99.1">/etc/pptpd. conf27echo "remoteip 172.16.99.2-254">/etc/pptpd. conf28 29 echo "ms-dns 8.8.8.8">/etc/ppp/pptpd-options30echo "ms-dns 8.8.4.4">/etc/ppp/pptpd-options31sed-I "s/require-mppe-128/# require-mppe-128 /g "/etc/ppp/pptpd-options32 33 echo" $ {user} pptpd $ {pass} * ">/etc/ppp/chap-secrets34 35 echo" VPN service is installed, your VPN username is $ {user}, VPN password is $ {pass} "after the script is executed and then restarted, the author can dizzy dows.