debian 9 VPN pptp

/etc/ppp/chap-secrets

SERVER\\USER PPTP PASS *

/etc/ppp/peers/VPNNAME

pty "/usr/sbin/pptp SERVER --nolaunchpppd"
name SERVER\\USER
remotename PPTP
require-mppe-128
file /etc/ppp/options.pptp
ipparam VPNNAME

vpn start

 pon VPNNAME

vpn stop

 poff VPNNAME

vpn test

 pon VPNNAME debug dump logfd 2 nodetach

/etc/network/interfaces

auto ppp0
iface ppp0 inet ppp
        provider VPNNAME

ip route
/etc/ppp/ip-up.d/NAME-route

#!/bin/bash
route add -net 192.168.0.0/16 dev ppp0
 chmod +x /etc/ppp/ip-up.d/NAME-route

Start if interface down by cron

#!/bin/bash
 
HOST=enter_check_ip
 
DATE=`date`
PINGRES=`ping -c 2 $HOST`
PLOSS=`echo $PINGRES : | grep -oP '\d+(?=% packet loss)'`
 
echo "$DATE : Loss Result : $PLOSS"
 
if [ "100" -eq "$PLOSS" ]; then
    echo "$DATE : Starting : $HOST"
    /usr/bin/pon lat updetach
    echo "$DATE : Now running : $HOST"
else
    echo "$DATE : Already running : $HOST"
fi

crontab -e

*/1  * * * * cd /root/cron && ./pptp_start.sh >> /var/log/pptp_pinger.log 2>&1

iptables

ACCEPT     47   --  0.0.0.0/0            0.0.0.0/0           
ACCEPT     tcp  --  0.0.0.0/0            0.0.0.0/0            tcp dpt:1723
Только авторизованные участники могут оставлять комментарии.
  • blog/debian_9_pptp.txt
  • Последние изменения: 2019/04/19