Спасибо, разобрался, связь обрывалась из-за плокирования на файрволле ICMP сообщений типа 3.
Кома интересно, нашел два скрипта для автоматизации pptp-соединения:
1.Use this script in /etc/init.d to control the client. The reason that I disable ECN when connecting is that the Compaq tunnel servers don't do ECN yet and reject the initial TCP connection request if I enable ECN :-(
#!/bin/sh
#
# /etc/rc.d/init.d/pptp
#
# chkconfig: 5 60 85
# description: PPTP Link Control
#
NAME="Tandem"
ADDRESS=tunnel-tandem.compaq.com
USER='Tandem\tommy'
ECN=0
DEBUG=
start_pptp() {
echo $ECN > /proc/sys/net/ipv4/tcp_ecn
if /usr/bin/pptp $ADDRESS user $USER noauth $DEBUG; then
touch /var/lock/subsys/pptp
echo "PPTP Connection to $NAME Started"
fi
}
stop_pptp() {
if killall /usr/bin/pptp 2> /dev/null; then
echo "Stopped pptp"
else
rm -f /var/run/pptp/*
fi
# if killall pppd; then
# echo "Stopped pppd"
# fi
rm -f /var/lock/subsys/pptp
echo 1 > /proc/sys/net/ipv4/tcp_ecn
}
case "$1" in
start)
echo "Starting PPTP Connection to ${NAME}..."
start_pptp
;;
stop)
echo "Stopping $NAME PPTP Connection..."
stop_pptp
;;
restart)
echo "Restarting $NAME PPTP Connection..."
stop_pptp
start_pptp
;;
status)
ifconfig
;;
*)
echo "Usage: $0 {start|stop|restart|status}"
;;
esac
2.Run the following script every five minutes under crond to restart the tunnel if it fails:
#!/bin/sh
restart_pptp() {
/sbin/service pptp stop
sleep 10
if /sbin/service pptp start; then
/usr/bin/logger "PPTP Restarted"
fi
}
if [ -n "`ps ax | grep /usr/bin/pptp | grep -v grep`" ]; then
exit 0
fi
echo "Attempting to restart PPTP"
restart_pptp > /dev/null 2>&1 &