Skip to content

Instantly share code, notes, and snippets.

@eknkc
Forked from alvinl/vpn.sh
Created March 13, 2013 15:25
Show Gist options
  • Save eknkc/5153181 to your computer and use it in GitHub Desktop.
Save eknkc/5153181 to your computer and use it in GitHub Desktop.
#!/bin/bash
apt-get update
apt-get install pptpd -y
echo localip 192.168.240.1 >> /etc/pptpd.conf
echo remoteip 192.168.240.2-9 >> /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 "vpn pptpd pass123 *" | tee -a /etc/ppp/chap-secrets
/etc/init.d/pptpd restart
echo net.ipv4.ip_forward=1 >> /etc/sysctl.conf
sysctl -p
iptables -t nat -A POSTROUTING -o eth0 -j MASQUERADE
clear
echo Username: vpn Password: pass123
echo Change this in /etc/ppp/chap-secrets
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment