Download PPTP script
wget d.wsq.be/pptp
sh pptp

Details of PPTP script
sudo yum install ppp -y install pptp protocol.
sudo yum localinstall http://d.wsq.be/pptpd-1.4.0-1.el6.x86_64.rpm -y
sudo yum install iptables-utils.x86_64 -y
sudo chmod 766 /etc/pptpd.conf
revise pptp file to ready for modify.
echo -e "localip 192.168.1.1\nremoteip 192.168.1.34-238,192.168.1.245" >>/etc/pptpd.conf
sudo chmod 766 /etc/ppp/options.pptpd
sudo sed -i 's/^#ms-dns 10.0.0.1/ms-dns 8.8.8.8/' /etc/ppp/options.pptpd
sudo sed -i 's/^#ms-dns 10.0.0.2/ms-dns 8.8.4.4/' /etc/ppp/options.pptpd

sudo chmod 766 /etc/ppp/chap-secrets user name, protocol, password, *
echo "gmvpn pptpd gmvpn *" >> /etc/ppp/chap-secrets
sudo chmod 766 /etc/sysctl.conf
sudo sed -i 's/^net.ipv4.ip_forward = 0/net.ipv4.ip_forward = 1/' /etc/sysctl.conf

sudo sysctl -p save sysctl.
sudo iptables -t nat -A POSTROUTING -o eth0 -j MASQUERADE
sudo iptables -I FORWARD -p tcp --syn -s 192.168.1.0/24 -j TCPMSS --set-mss 1356
sudo service iptables save
sudo service iptables restart
sudo chkconfig pptpd on
sudo chkconfig iptables on
sudo init 6

Advertisements