[pptp-server] KeepAlive / Heartbeat

Gord Belsey gord at amador.ca
Tue Aug 8 09:33:34 CDT 2000


Hi, Ronnie:

PPP has a heartbat built in to it using LCP timeouts - lcp-echo.  What I've
done to accomplish what you're doing is to use them in combination with
/etc/ip-down.local script.....ip-down will run ip-down.local if it exists
with execute permissions.  I tweaked the LCP timeouts by adding the
following to /etc/ppp/options:

lcp-echo-failure 10
lcp-echo-interval 1

I added this on both the pptp client and the pptp server . In this case, the
timeout is 10 seconds, with a 1 second interval for the next heartbeat.  In
a nutshell, if an lcp-echo isn't received in 1 second it is considered
failed.  If 10 lcp-echo's fail in a row, the connection is considered down.
On the server side, it just brings down the ppp interface used by that
connection.  On the client side, where I have ip-down.local script set up,
the ppp interface is brought down.  That automagically runs ip-down, which
automagically runs ip-down.local.  In ip-dwon.local, I call a start up
script to reopen a client connection to the server.

A couple notes:

- I added the lcp-echo-timeout and lcp-echo-interval to both server and
client
- The numbers in my above example are from my R&D server....on my production
server, I use lcp-echo-timeout 10 and lcp-failure 6, which basically says if
there's no response from the other side in 60 seconds consider the link
down.  You can play around with the numbers a bit to find your "best
mileage"
- In my /etc/ppp/ip-down.local on the client, I restart the client, sleep
for 30 seconds, then check to see if the client comes up.  If not, I try
again.  This works so-so, but the intention is to deal with the server
"going away" for a while (ie: loses network connectn, crashes, gets rebooted
et al).  The idea is that as soon as the client sees the server, it'll bring
up a connection.  Works great in theory, but I haven't got it perfect in
production yet :o)

Hope this is helpful

Gord Belsey
----- Original Message -----
From: Ronnie F. Moller, Jr. <support at redware.net>
To: <pptp-server at lists.schulte.org>
Sent: Friday, August 04, 2000 5:59 PM
Subject: [pptp-server] KeepAlive / Heartbeat


> I am using a PPTP Client on linux, and have a script that runs every
minute
> from cron, the script is the following:
>
> ping -c 1 172.16.1.4 || /etc/rc.d/init.d/pptp restart
>
> what I have noticed is that ping sometimes fails during high latency, when
> the connection is just busy / overloaded temporarily. Is there a better
way
> to test, so that if it fails 5 times in a row, then it would call the
> restart. If it where to get 1 succesful ping out of 5, then I would assume
> that it is a good connection, just busy.
>
> Thanks
>
> _______________________________________________
> pptp-server maillist  -  pptp-server at lists.schulte.org
> http://lists.schulte.org/mailman/listinfo/pptp-server
> List services provided by www.schulteconsulting.com!
>




More information about the pptp-server mailing list