随手记——centos上pptp一键安装脚本

作者:Young.Liu 分类: 技术 发布于:2015-3-16 21:48 ė2650次浏览 62条评论

### File: pptp.sh

#===================================================================

#   SYSTEM REQUIRED:  CentOS 6.x (32bit/64bit)
#   DESCRIPTION:  Install pptpd VPN
#===================================================================
clear
echo "#############################################################"
echo "# One-hit Install Script for PPTP VPN"
echo "# Distribution: CentOS 6.x(32bit/64bit)"
echo ""
echo "# Author: Null <she@521.be>"
echo ""
echo "#############################################################"
echo ""
# Install some necessary tools
yum -y install pptpd
echo 1 > /proc/sys/net/ipv4/ip_forward
echo "localip "`ifconfig  | grep 'inet addr:'| grep -v '127.0.0.1' | cut -d: -f2 | awk 'NR==1 { print $1}'` >> /etc/pptpd.conf
echo "remoteip 192.168.0.100-150" >> /etc/pptpd.conf
echo "ms-dns 8.8.8.8" >> /etc/ppp/options.pptpd
echo "ms-dns 8.8.4.4" >> /etc/ppp/options.pptpd

echo "vpn pptpd 123456 *" >> /etc/ppp/chap-secrets

wget http://huakai.org/iptables.zip

if [ -f "./iptables.zip" ]; then 
\cp ./iptables.zip /etc/sysconfig/iptables
chkconfig pptpd on
service iptables restart
service pptpd start
echo ""
echo "VPN service installed successfully."
echo "Please visit: http://521.be"
echo ""
else
echo ""
echo "VPN service installed fail, the file(iptables.zip) not exists"
echo "Please visit: http://521.be"
echo ""
fi

exit 0

本文出自 我的技术积累,转载时请注明出处及相应链接。


评论

  1. 东北大米 2015-07-30 16:59 回复

    不错 学习了

  2. 秦皇岛婚纱照 2015-06-30 22:58 回复

    正需要,技术很高

Ɣ回顶部