Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@

## 安装

sudo sh pptpd_x64.sh [subnet]
sudo sh pptpd_x64.sh [subnet] [password]


## 添加用户
Expand Down
20 changes: 12 additions & 8 deletions pptpd_i686.sh
Original file line number Diff line number Diff line change
@@ -1,8 +1,16 @@

SUBNET=$1

if [ -z "${SUBNET}" ]; then
SUBNET=
PASS=

if [ "$2" != "" ]; then
SUBNET=$1
PASS=$2
elif [ "$1" != "" ]; then
SUBNET=$1
PASS=`openssl rand 6 -base64`
else
SUBNET=192.168.0
PASS=`openssl rand 6 -base64`
fi

yum remove -y pptpd ppp
Expand All @@ -20,11 +28,7 @@ echo "remoteip ${SUBNET}.234-238,${SUBNET}.245" >> /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
echo "vpn pptpd ${PASS} *" >> /etc/ppp/chap-secrets

sed -i 's/net.ipv4.ip_forward = 0/net.ipv4.ip_forward = 1/' /etc/sysctl.conf
sed -i 's/net.ipv4.tcp_syncookies = 1/#net.ipv4.tcp_syncookies = 1/' /etc/sysctl.conf
Expand Down
20 changes: 12 additions & 8 deletions pptpd_x64.sh
Original file line number Diff line number Diff line change
@@ -1,8 +1,16 @@

SUBNET=$1

if [ -z "${SUBNET}" ]; then
SUBNET=
PASS=

if [ "$2" != "" ]; then
SUBNET=$1
PASS=$2
elif [ "$1" != "" ]; then
SUBNET=$1
PASS=`openssl rand 6 -base64`
else
SUBNET=192.168.0
PASS=`openssl rand 6 -base64`
fi

yum remove -y pptpd ppp
Expand All @@ -21,11 +29,7 @@ echo "remoteip ${SUBNET}.234-238,${SUBNET}.245" >> /etc/pptpd.conf
echo "debug" >> /etc/ppp/options.pptpd
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
echo "vpn pptpd ${PASS} *" >> /etc/ppp/chap-secrets

sed -i 's/net.ipv4.ip_forward = 0/net.ipv4.ip_forward = 1/' /etc/sysctl.conf
sed -i 's/net.ipv4.tcp_syncookies = 1/#net.ipv4.tcp_syncookies = 1/' /etc/sysctl.conf
Expand Down