Skip to content

Instantly share code, notes, and snippets.

What would you like to do?
Automaticlly install pptpd on Ubuntu 10.04
# Authors: Alvin Ye
# Run by: curl -sL | sudo bash
sudo apt-get install pptpd
sed -i 's/^logwtmp/#logwtmp/g' /etc/pptpd.conf
sed -i 's/^net.ipv4.ip_forward = 0/net.ipv4.ip_forward = 1/g' /etc/sysctl.conf
sysctl -p
echo "localip" >> /etc/pptpd.conf
echo "remoteip" >> /etc/pptpd.conf
echo "ms-dns" >> /etc/ppp/options
echo "ms-dns" >> /etc/ppp/options
pass=`openssl rand 8 -base64`
if [ "$1" != "" ]
then pass=$1
echo "vpn pptpd ${pass} *" >> /etc/ppp/chap-secrets
iptables -t nat -A POSTROUTING -s -j SNAT --to-source `ifconfig | grep 'inet addr:'| grep -v '' | cut -d: -f2 | awk 'NR==1 { print $1}'`
iptables -A FORWARD -p tcp --syn -s -j TCPMSS --set-mss 1356
sudo iptables-save
sudo /etc/init.d/iptables restart
sudo /etc/init.d/pptpd restart
echo -e "VPN service is installed, your VPN username is \033[1mvpn\033[0m, VPN password is \033[1m${pass}\033[1m"
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.