Skip to content

Instantly share code, notes, and snippets.

@simpzan

simpzan/pptpd.sh

Created Aug 14, 2015
Embed
What would you like to do?
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

This comment has been minimized.

Copy link
Owner Author

@simpzan simpzan commented Oct 22, 2020

hello

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.