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.

Revisions

  1. HenryYang revised this gist Mar 3, 2019. 1 changed file with 0 additions and 3 deletions.
    3 changes: 0 additions & 3 deletions pp2t_vpn.sh
    Original file line number Diff line number Diff line change
    @@ -25,9 +25,6 @@ apt install -y iptables-persistent

    iptables-save > /etc/iptables-rules

    pre-up iptables-restore < /etc/iptables-rules


    echo "net.ipv4.ip_forward=1" >> /etc/sysctl.conf

    sysctl -p
  2. HenryYang revised this gist Mar 3, 2019. 1 changed file with 3 additions and 3 deletions.
    6 changes: 3 additions & 3 deletions pp2t_vpn.sh
    Original file line number Diff line number Diff line change
    @@ -1,8 +1,8 @@
    #!/bin/bash

    apt-get update
    apt update

    apt-get install -y pptpd
    apt install -y pptpd

    echo "localip 192.168.0.1" >> /etc/pptpd.conf
    echo "remoteip 192.168.0.128-255" >> /etc/pptpd.conf
    @@ -21,7 +21,7 @@ echo "$uname pptpd $upwd 192.168.0.135" >> /etc/ppp/chap-secrets

    iptables -t nat -A POSTROUTING -s 192.168.0.0/24 -o eth0 -j MASQUERADE

    apt-get install -y iptables-persistent
    apt install -y iptables-persistent

    iptables-save > /etc/iptables-rules

  3. HenryYang created this gist Feb 17, 2016.
    34 changes: 34 additions & 0 deletions pp2t_vpn.sh
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,34 @@
    #!/bin/bash

    apt-get update

    apt-get 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-get install -y iptables-persistent

    iptables-save > /etc/iptables-rules

    pre-up iptables-restore < /etc/iptables-rules


    echo "net.ipv4.ip_forward=1" >> /etc/sysctl.conf

    sysctl -p