#!/bin/bash
pacman -S iptables pptpd
echo “iptables -A INPUT -i ppp+ -j ACCEPT” >> /etc/rc.local
echo “iptables -A OUTPUT -o ppp+ -j ACCEPT” >> /etc/rc.local
echo “iptables -A INPUT -p tcp –dport 1723 -j ACCEPT” >> /etc/rc.local
echo “iptables -A INPUT -p 47 -j ACCEPT” >> /etc/rc.local
echo “iptables -A OUTPUT -p 47 -j ACCEPT” >> /etc/rc.local
echo “iptables -F FORWARD” >> /etc/rc.local
echo “iptables -A FORWARD -j ACCEPT” >> /etc/rc.local
echo “iptables -A POSTROUTING -t nat -o eth0 -j MASQUERADE” >> /etc/rc.local
echo “iptables -A POSTROUTING -t nat -o ppp+ -j MASQUERADE” >> /etc/rc.local
echo “echo 1 > /proc/sys/net/ipv4/ip_forward” >> /etc/rc.local
echo “option /etc/ppp/pptpd-options” >> /etc/pptpd.conf
echo “localip 172.16.36.1” >> /etc/pptpd.conf
echo “remoteip 172.16.36.2-254” >> /etc/pptpd.conf
touch /etc/ppp/pptpd-options
echo “name pptpd” >> /etc/ppp/pptpd-options
echo “refuse-pap” >> /etc/ppp/pptpd-options
echo “refuse-chap” >> /etc/ppp/pptpd-options
echo “refuse-mschap” >> /etc/ppp/pptpd-options
echo “require-mschap-v2” >> /etc/ppp/pptpd-options
echo “require-mppe-128” >> /etc/ppp/pptpd-options
echo “proxyarp” >> /etc/ppp/pptpd-options
echo “lock” >> /etc/ppp/pptpd-options
echo “nobsdcomp” >> /etc/ppp/pptpd-options
echo “novj” >> /etc/ppp/pptpd-options
echo “novjccomp” >> /etc/ppp/pptpd-options
echo “nologfd” >> /etc/ppp/pptpd-options
echo “ms-dns 8.8.8.8” >> /etc/ppp/pptpd-options
echo “ms-dns 8.8.4.4” >> /etc/ppp/pptpd-options
pass=`openssl rand 18 -base64`
if [ “$1” != “” ]
then pass=$1
fi
echo “sushiyant pptpd ${pass} *” >> /etc/ppp/chap-secrets
/etc/rc.local
/etc/rc.d/pptpd start
echo “VPN service is installed , Your VPN username is sushiyant , VPN password is ${pass}”
echo “To have pptpd server in any boot add it to DAEMONS=(… pptpd …)”
- echo “We are here me@sushiyant.org , Thank you !”