Created
August 14, 2015 05:53
-
-
Save simpzan/ff26632ca7af1daeb994 to your computer and use it in GitHub Desktop.
pptp setup
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
echo "######################################################" | |
echo "Start Install" | |
echo "######################################################" | |
echo "Enter username that you want to create:" | |
read u | |
echo "Enter password that you want to use:" | |
read p | |
# set the VPS IP | |
ip=your ip here! | |
apt-get update | |
apt-get -y install pptpd | |
cat > /etc/ppp/pptpd-options <<END | |
name pptpd | |
refuse-pap | |
refuse-chap | |
refuse-mschap | |
require-mschap-v2 | |
require-mppe-128 | |
ms-dns 8.8.8.8 | |
ms-dns 8.8.4.4 | |
proxyarp | |
nodefaultroute | |
lock | |
nobsdcomp | |
END | |
echo "option /etc/ppp/pptpd-options" > /etc/pptpd.conf | |
echo "logwtmp" >> /etc/pptpd.conf | |
echo "localip $ip" >> /etc/pptpd.conf | |
echo "remoteip 10.1.0.1-100" >> /etc/pptpd.conf | |
echo "$u * $p *" >> /etc/ppp/chap-secrets | |
cat >> /etc/sysctl.conf <<END | |
net.ipv4.ip_forward=1 | |
END | |
sysctl -p | |
iptables -t nat -A POSTROUTING -j SNAT --to $ip | |
iptables-save > /etc/iptables.conf | |
cat > /etc/network/if-pre-up.d/iptables <<END | |
#!/bin/sh | |
iptables-restore < /etc/iptables.conf | |
END | |
chmod +x /etc/network/if-pre-up.d/iptables | |
cat >> /etc/ppp/ip-up <<END | |
ifconfig ppp0 mtu 1400 | |
END | |
sleep 5 | |
/etc/init.d/pptpd restart | |
echo | |
echo "######################################################" | |
echo "Complete!" | |
echo "Connect your VPN at $ip" | |
echo "Username:$u Password: $p" | |
echo "######################################################" | |
exit |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
hello