Skip to content

Instantly share code, notes, and snippets.

@simpzan
Created August 14, 2015 05:53
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save simpzan/ff26632ca7af1daeb994 to your computer and use it in GitHub Desktop.
Save simpzan/ff26632ca7af1daeb994 to your computer and use it in GitHub Desktop.
pptp setup
#!/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
@simpzan
Copy link
Author

simpzan commented Oct 22, 2020

hello

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment