L2TP and Cables in Israel, fixups

When I’ve created my setup (displayed below), I took into account the possibility of disconnection, or process fall, and I’ve left pppd to deal with it, by trying to connect just as it has fallen down. It was a good solution for the scenarios where there is a temporary, short timed disconnection. It fails to work when pppd cannot establish a connection as soon as it has dropped, which might happen when the ISP has a problem, or someone disconnects the cables, etc.

To try and approach it using an add-on solution (as I don’t feel I have a complete and simple enough solution for the issue), I have added the following things:
 

1. Added a line in /etc/crontab , adding a per-minute scheduled class:

0-59/1 * * * * root run-parts /etc/cron.minute

2. Created a directory /etc/cron.minute
3. Added a script into it, called Internet, as follows:

1
2
3
4
#!/bin/sh
if [ ! "`ifconfig | grep ppp0`" ]; then
/etc/init.d/rp-l2tp start
fi

 

The solution brings back the connection in the rather rare event of it being down. It will not solve, even combined with the current “bring it up when it goes down” configuration all and every possible problem. I hope it would solve enough. I will not list my expected problems with such a configuration, but leave it as an exercise for you.

Tags: , , ,

Leave a Reply