Skip to content

Instantly share code, notes, and snippets.

@HenryYang
Last active March 3, 2019 04:07
Show Gist options
  • Save HenryYang/b4adcbc20c7bcde6e648 to your computer and use it in GitHub Desktop.
Save HenryYang/b4adcbc20c7bcde6e648 to your computer and use it in GitHub Desktop.
Easy Install PP2P VPN
#!/bin/bash
apt update
apt install -y pptpd
echo "localip 192.168.0.1" >> /etc/pptpd.conf
echo "remoteip 192.168.0.128-255" >> /etc/pptpd.conf
echo "ms-dns 8.8.8.8" >> /etc/ppp/pptpd-options
echo "ms-dns 8.8.4.4" >> /etc/ppp/pptpd-options
echo -n "Enter User Name:"
read uname
echo -n "Enter Password:"
read upwd
echo "$uname pptpd $upwd 192.168.0.135" >> /etc/ppp/chap-secrets
/etc/init.d/pptpd restart
iptables -t nat -A POSTROUTING -s 192.168.0.0/24 -o eth0 -j MASQUERADE
apt install -y iptables-persistent
iptables-save > /etc/iptables-rules
echo "net.ipv4.ip_forward=1" >> /etc/sysctl.conf
sysctl -p
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment