• 公告栏使用li标签,同时你可以使用FontAwesome以及其他HTML语法
  • FontAwesome示例
  • 罗马城之所以是这样的罗马城是因为市民就是这样的市民! This City is what it is because our citizens are what they are@柏拉图

pptpd安装脚本

菜鸟Linux笔记 shaobo 39次浏览 1943字 0个评论

脚本网上找的,32位系统适用,内容如下

#! /bin/sh

#

### BEGIN INIT INFO

# Provides: pptpd instll

# PowerBY: fireye

# website: http//www.hichou.com www.qinday.com

# Description: pptpd install for centos vps

### END INIT INFO

#

 

yum remove -y pptpd ppp

iptables –flush POSTROUTING –table nat

iptables –flush FORWARD

rm -rf /etc/pptpd.conf

rm -rf /etc/ppp

 

wget http://packages.sw.be/dkms/dkms-2.1.1.2-1.el5.rf.noarch.rpm

wget “http://nchc.dl.sourceforge.net/project/poptop/mppe%20module%20builder/kernel_ppp_mppe-1.0.2%20dkms-2.0.6/kernel_ppp_mppe-1.0.2-3dkms.noarch.rpm”

wget http://www.diahosting.com/dload/pptpd-1.3.4-1.rhel5.1.i386.rpm

wget ftp://ftp.ntua.gr/pub/net/poptop/OldFiles/pptpd-1.1.3-1.i386.rpm

wget http://mirrors.163.com/centos/5.6/os/i386/CentOS/ppp-2.4.4-2.el5.i386.rpm

 

yum -y install make libpcap iptables gcc-c++ logrotate tar cpio perl pam tcp_wrappers

rpm -ivh dkms-2.1.1.2-1.el5.rf.noarch.rpm

rpm -ivh kernel_ppp_mppe-1.0.2-3dkms.noarch.rpm

rpm -qa kernel_ppp_mppe

rpm -Uvh ppp-2.4.4-2.el5.i386.rpm

rpm -ivh pptpd-1.3.4-1.rhel5.1.i386.rpm

 

mknod /dev/ppp c 108 0

echo 1 > /proc/sys/net/ipv4/ip_forward

echo “mknod /dev/ppp c 108 0″ >> /etc/rc.local

echo “echo 1 > /proc/sys/net/ipv4/ip_forward” >> /etc/rc.local

echo “localip 172.16.36.1″ >> /etc/pptpd.conf

echo “remoteip 172.16.36.2-254″ >> /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

 

pass=`openssl rand 6 -base64`

if [ "$1" != "" ]

then pass=$1

fi

 

echo “vpn pptpd ${pass} *” >> /etc/ppp/chap-secrets

 

iptables -t nat -A POSTROUTING -s 172.16.36.0/24 -j SNAT –to-source `ifconfig | grep ‘inet addr:’| grep -v ’127.0.0.1′ | cut -d: -f2 | awk ‘NR==1 { print $1}’`

iptables -A FORWARD -p tcp –syn -s 172.16.36.0/24 -j TCPMSS –set-mss 1356

iptables -A RH-Firewall-1-INPUT -p tcp -m state –state NEW -m tcp –dport 1723 -j ACCEPT

iptables -A RH-Firewall-1-INPUT -p tcp -m state –state NEW -m tcp –dport 47 -j ACCEPT

 

service iptables save

chkconfig iptables on

chkconfig pptpd on

 

service iptables start

service pptpd restart

 

echo “VPN service is installed, your VPN username is vpn, VPN password is ${pass}”

VPN service is installed, your VPN username is vpn, VPN password is OBoyvanl


喜欢 (0)

您必须 登录 才能发表评论!