dbiesecke
7/2/2014 - 10:47 PM

pptpd simple setup

pptpd simple setup

Basic Networksetup

  • should be in startup script

      `iptables -A POSTROUTING -t nat -o ppp+ -j MASQUERADE
          echo 1 > /proc/sys/net/ipv4/ip_forward`
    

PPTPD Setup

  • install pptpd apt-get install pptpd

  • Edit remoteip and ip ranges at /etc/pptpd.conf

  • edit user accounts at /etc/ppp/chap-secrets

      #username      server      password    remote IP addresses
          pptpusername   pptpd secretpassword    45.45.45.45
    
  • Restart the PPtP daemon service pptpd restart

PPTP Client

    pptpsetup –create –server yourserver.com –username pptpusername –password secretpassword –start
  • Script for cronjob for restart as attach
#!/bin/bash
VPNIP=172.16.0.1
TUNNELNAME=miner
ping -c3  $VPNIP> /tmp/pingreport
result=`grep "0 received" /tmp/pingreport`
truncresult="`echo "$result" | sed 's/^\(.................................\).*$/\1/'`"
if [[ $truncresult == "3 packets transmitted, 0 received" ]]; then
    pon $TUNNELNAME
fi