Last active
March 3, 2019 04:07
-
-
Save HenryYang/b4adcbc20c7bcde6e648 to your computer and use it in GitHub Desktop.
Easy Install PP2P VPN
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 | |
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