echo''
echo'**********************************************************'
echo'*******PPTPD×××servicewasinstalled*******'
echo'*******http://shell.daobidao.com*******'
echo'**********************************************************'
echo''
yum-yinstallyum-fastestmirror
yum-yinstalliptablesgcc-ctarrpmperlppp
if[`getconfWORD_BIT`='32']&&[`getconfLONG_BIT`='64'];then
wget-chttp://code-jinchengjiang.googlecode.com/files/pptpd-1.3.4-1.rhel5.1.x86_64.rpm
rpm-ivhpptpd-1.3.4-1.rhel5.1.x86_64.rpm
else
wget-chttp://code-jinchengjiang.googlecode.com/files/pptpd-1.3.4-1.rhel5.1.i386.rpm
rpm-ivhpptpd-1.3.4-1.rhel5.1.i386.rpm
fi
sed-i's/#ms-dns10.0.0.1/ms-dns208.67.222.222/'/etc/ppp/options.pptpd
sed-i's/#ms-dns10.0.0.2/ms-dns8.8.8.8/'/etc/ppp/options.pptpd
sed-i's/#localip192.168.0.1/localip192.168.0.1/'/etc/pptpd.conf
sed-i's/#remoteip192.168.0.234-238,192.168.0.245/remoteip192.168.0.2-200/'/etc/pptpd.conf
sed-i's/net.ipv4.ip_forward=0/net.ipv4.ip_forward=1/'/etc/sysctl.conf
/sbin/sysctl-p
#set***user
user="***"
echo"Pleaseinputuser:"
read-p"(Defaultuser:***):"user
if["$user"=""];then
user="***"
fi
echo"==========================="
echouser="$user"
echo"==========================="
#set***userpass
pass="***"
echo"Pleaseinputuserpass:"
read-p"(Defaultpass:***):"pass
if["$pass"=""];then
pass="***"
fi
echo"==========================="
echopass="$pass"
echo"==========================="
echo-e"$userpptpd$pass*">>/etc/ppp/chap-secrets
serviceiptablesstart
iptables-AINPUT-ptcp--dport1723-jACCEPT
iptables-tnat-APOSTROUTING-s192.168.0.0/24-oeth1-jMASQUERADE
serviceiptablessave
serviceiptablesrestart
servicepptpdstart
chkconfigiptableson
chkconfigpptpdon
转载于:https://blog.51cto.com/daspr/1310445